/* =========================
   HEADER CLIENTES
========================= */

.clientes-header {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 15px;
}

.clientes-header h2 {
  flex: 1 1 100%;
}

#buscadorClientes,
.select-filtro-direccion {
  flex: 1 1 250px;
  padding: 8px 14px;
  border-radius: 20px;
  border: 1px solid rgba(0, 247, 255, 0.35);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  outline: none;
}

.select-filtro-direccion {
  max-width: 320px;
  min-width: 220px;
  cursor: pointer;
}

.select-filtro-direccion option {
  background: #08101a;
  color: #fff;
}


.filtros-clientes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filtro-btn,
.btn-volver-icon {
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(0, 247, 255, 0.3);
  background: rgba(0, 0, 0, 0.3);
  color: #fff;
  cursor: pointer;
  min-width: 80px;
}



.clientes-mobile-toolbar {
  display: none;
  width: 100%;
}

.btn-menu-clientes {
  width: 100%;
  padding: 10px 14px;
  border-radius: 16px;
  border: 1px solid rgba(0, 247, 255, 0.28);
  background: linear-gradient(135deg, rgba(8, 16, 26, 0.96), rgba(10, 30, 48, 0.96));
  color: #ffffff;
  font-weight: 700;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 247, 255, 0.08);
}

.btn-menu-clientes.is-open {
  background: linear-gradient(90deg, rgba(0,247,255,.22), rgba(255,123,255,.18));
}

.clientes-mobile-menu {
  width: 100%;
}
.filtro-btn.active {
  background: linear-gradient(90deg, #00f7ff, #ff7bff);
  color: #000;
  font-weight: bold;
}

/* =========================
   TARJETAS CLIENTES
========================= */

.finance-card {
  background: linear-gradient(145deg, #0b1623, #08101a);
  border-radius: 20px;
  padding: 50px 18px 18px;
  position: relative;
  transition: .25s ease;
  box-shadow: 0 0 25px rgba(0,247,255,.08);
  width: 100%;
  cursor: pointer;
  overflow: hidden;
}

.finance-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 0 30px rgba(0,247,255,.18);
}

/* Cabecera principal de cada tarjeta */
.card-left {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  min-width: 0;
  padding-right: 135px; /* reserva espacio para el valor */
}

.avatar {
  width: 50px;
  height: 50px;
  min-width: 50px;
  background: rgba(0,247,255,.15);
  border: 1px solid #00f7ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 18px;
  color: #00f7ff;
}

.card-left > div:last-child {
  flex: 1;
  min-width: 0;
}

.finance-card h3 {
  margin: 0;
  color: #00f7ff;
  font-size: 1.05rem;
  line-height: 1.2;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: anywhere !important;
}

.finance-card p {
  margin: 4px 0;
  font-size: .85rem;
  opacity: .8;
}

.finance-card small {
  display: block;
  font-size: .75rem;
  opacity: .6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Valor a la derecha sin encimarse sobre el nombre */
.card-right {
  position: absolute;
  right: 18px;
  top: 18px;
  width: 110px;
  text-align: right;
}

.card-right h2 {
  margin: 0;
  color: #ff7dfc;
  font-size: 1.2rem;
  line-height: 1.15;
  white-space: nowrap;
}

.card-right small {
  margin-top: 6px;
  white-space: nowrap;
}

/* Tel¡§0„7fono del cliente */
.cliente-telefono {
  margin: 2px 0;
  font-size: 0.82rem;
  opacity: 0.9;
}

.cliente-telefono.telefono-vacio {
  color: #ffb4b4;
  font-weight: 700;
}

/* Direcci¨®n del cliente dentro de la card de cobranza.
   Se muestra sutil para diferenciar clientes con nombres iguales sin competir visualmente. */
.cliente-direccion {
  display: inline-flex;
  align-items: center;
  max-width: min(100%, 210px);
  margin: 1px 0 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  line-height: 1.25;
  color: #c9d8ff;
  background: rgba(125, 150, 255, 0.08);
  border: 1px solid rgba(125, 150, 255, 0.16);
  opacity: 0.78;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

@media (max-width: 720px) {
  .cliente-direccion {
    max-width: 100%;
    font-size: 0.73rem;
  }
}

/* Barra de progreso */
.progress-bar {
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 10px;
  margin-top: 16px;
  overflow: hidden;
  width: 100%;
}

.progress {
  height: 100%;
  background: linear-gradient(90deg, #00f7ff, #ff7dfc);
  border-radius: 10px;
  transition: width .4s ease;
}

/* Alerta de deuda alta */
.badge-alerta {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg,#ff3b3b,#ff7a18);
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(255,60,60,0.6);
  animation: alertaPulse 1.5s infinite;
  z-index: 7;
}

@keyframes alertaPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* Checkbox de recordatorio: compacto para no pisar el l¡§0„4piz */
.check-recordatorio-wrap {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 8;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 118px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(12, 23, 38, 0.95);
  border: 1px solid rgba(0, 229, 255, 0.35);
  color: #ffffff;
  font-size: 10px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}

.check-recordatorio-wrap input {
  width: 13px;
  height: 13px;
  margin: 0;
  flex: 0 0 auto;
  cursor: pointer;
}

.check-recordatorio-wrap span {
  display: inline-block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.check-recordatorio-wrap.sin-telefono {
  max-width: 98px;
  background: rgba(160, 50, 50, 0.95);
  border-color: rgba(255, 125, 125, 0.45);
  cursor: not-allowed;
}

/* Bot¡§0…3n l¡§0„4piz de editar: siempre a la derecha */
.btn-editar-cliente {
  position: absolute;
  top: 12px;
  right: 14px;
  z-index: 12;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(0,247,255,.28);
  border-radius: 10px;
  background: rgba(255,255,255,.05);
  color: #00f7ff;
  cursor: pointer;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: .2s ease;
}

.btn-editar-cliente:hover {
  background: rgba(0,247,255,.12);
  box-shadow: 0 0 12px rgba(0,247,255,.22);
  transform: scale(1.05);
}

/* =========================
   HISTORIAL
========================= */

.historial-card {
  background: linear-gradient(145deg, #0f1f2e, #13283b);
  border-radius: 16px;
  padding: 15px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  transition: .2s ease;
}

.historial-card:hover {
  transform: scale(1.02);
}

.historial-left {
  flex: 1;
  min-width: 0;
}

.historial-card.pago .historial-tipo {
  color: #00ff88;
}

.historial-card.aumento .historial-tipo {
  color: #ffcc00;
}

.historial-card.promesa .historial-tipo {
  color: #00cfff;
}

.historial-tipo {
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 5px;
}

.historial-fecha {
  opacity: .7;
  font-size: 14px;
  margin-bottom: 5px;
}

.historial-concepto {
  opacity: .8;
  font-size: 14px;
}

.historial-monto {
  font-weight: bold;
  font-size: 18px;
  white-space: nowrap;
}

.historial-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
}

.btn-mov-editar,
.btn-mov-eliminar {
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  cursor: pointer;
}

#btnGuardarMovimiento,
#btnCancelarMovimiento {
  padding: 12px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  transition: .2s ease;
}

#btnGuardarMovimiento {
  background: linear-gradient(90deg, #00f7ff, #1788ff);
  color: #000;
}

#btnGuardarMovimiento:hover,
#btnCancelarMovimiento:hover {
  transform: translateY(-1px);
}

#btnCancelarMovimiento:hover {
  background: #39425e;
}

/* =========================
   MODAL
========================= */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: #1c2233;
  border-radius: 20px;
  padding: 25px;
  width: 95%;
  max-width: 450px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}

.modal-content input,
.modal-content select {
  width: 100%;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid #2b3145;
  background: #141a2b;
  color: #fff;
  margin-bottom: 12px;
}

.close-btn {
  position: absolute;
  right: 18px;
  top: 15px;
  font-size: 22px;
  cursor: pointer;
}

/* =========================
   PERIODO Y RESUMEN
========================= */

.periodo-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 20px;
}

.periodo-btn {
  border: 1px solid rgba(0,247,255,.25);
  background: rgba(255,255,255,.04);
  color: #fff;
  border-radius: 12px;
  padding: 10px 14px;
  cursor: pointer;
}

.btn-generar-mes {
  background: linear-gradient(90deg, #00f7ff, #1788ff);
  color: #000;
  font-weight: 700;
  border: none;
}

.btn-generar-mes:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 12px rgba(0,247,255,.25);
}

#periodoActual {
  min-width: 140px;
  text-align: center;
}

.resumen-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.resumen-card {
  background: linear-gradient(145deg, #203a63, #314a7c);
  border-radius: 22px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 0 18px rgba(0,0,0,.18);
}

.resumen-card h3 {
  margin-bottom: 10px;
  font-size: 1rem;
  color: rgba(255,255,255,.88);
}


.resumen-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.resumen-card-header h3 {
  margin-bottom: 0;
}

.btn-ocultar-total {
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(255,255,255,.12);
  color: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: .78rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.btn-ocultar-total:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.18);
  box-shadow: 0 0 12px rgba(255,255,255,.14);
}

#totalCobradoMes.dato-oculto {
  letter-spacing: 3px;
  user-select: none;
}

.resumen-card p {
  font-size: 1.8rem;
  font-weight: 800;
  color: #fff;
  margin: 0;
}

/* =========================
   LOADER APP
========================= */

.app-loader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at top, #08131f, #050b14 70%);
  transition: opacity .45s ease, visibility .45s ease;
}

.app-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-box {
  width: min(90%, 360px);
  text-align: center;
  padding: 28px 24px;
  border-radius: 24px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(0,247,255,.16);
  box-shadow:
    0 0 30px rgba(0,247,255,.08),
    0 0 80px rgba(0,0,0,.25);
  backdrop-filter: blur(12px);
}

.loader-logo {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 14px;
  box-shadow:
    0 0 18px rgba(0,247,255,.25),
    0 0 36px rgba(0,247,255,.12);
  animation: loaderPulse 1.8s infinite ease-in-out;
}

.loader-box h2 {
  margin: 0 0 8px;
  color: #fff;
  letter-spacing: .12em;
  font-size: 1.15rem;
}

.loader-box p {
  margin: 0 0 16px;
  color: rgba(255,255,255,.72);
  font-size: .95rem;
}

.loader-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255,255,255,.08);
}

.loader-bar-fill {
  height: 100%;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00f7ff, #1788ff, #ff7dfc);
  animation: loaderRun 1.3s infinite ease-in-out;
}

@keyframes loaderRun {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(260%); }
}

@keyframes loaderPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {
  .clientes-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  #buscadorClientes,
.select-filtro-direccion {
    width: 100%;
    max-width: 100%;
    height: 42px;
    padding: 10px 14px;
    font-size: 14px;
    flex: none;
    border-radius: 14px;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(0,247,255,.2);
  }

  .filtros-clientes {
    justify-content: center;
  }

  .periodo-bar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .periodo-btn {
    flex: 1;
    min-width: 80px;
  }

  #periodoActual {
    width: 100%;
    order: -1;
  }

  .resumen-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    width: 95%;
    max-width: 95%;
  }
}

@media (max-width: 680px) {
  .finance-card {
    padding: 50px 15px 15px;
  }

  .card-left {
    padding-right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .card-right {
    position: static;
    width: 100%;
    text-align: left;
    margin-top: 8px;
  }

  .card-right h2,
  .card-right small {
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .finance-card {
    padding: 52px 14px 14px;
  }

  .finance-card h3 {
    font-size: 1rem;
  }

  .check-recordatorio-wrap {
    max-width: 105px;
    font-size: 10px;
    padding: 5px 7px;
  }

  .check-recordatorio-wrap.sin-telefono {
    max-width: 88px;
  }

  .historial-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .historial-monto {
    font-size: 16px;
  }

  .loader-box {
    padding: 22px 18px;
  }

  .loader-logo {
    width: 82px;
    height: 82px;
  }

  .loader-box h2 {
    font-size: 1rem;
  }
}

/* =========================
   FIX L0†9PIZ + ALERTA DEUDA
========================= */

/* M¨¢s espacio arriba para badges y acciones */
.finance-card {
  padding-top: 62px !important;
}

/* Alerta de clientes con deuda alta */
.badge-alerta {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 8 !important;

  background: linear-gradient(135deg, #ff2d55, #ff8a00) !important;
  color: #ffffff !important;

  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;

  padding: 5px 9px;
  font-size: 11px;
  font-weight: 800;

  box-shadow: 0 0 12px rgba(255, 75, 75, 0.55);
  max-width: 105px;
  white-space: nowrap;
}

/* Bot¨®n editar m¨¢s visible y separado de la alerta */
.btn-editar-cliente {
  position: absolute !important;
  top: 43px !important;
  right: 14px !important;
  z-index: 10 !important;

  width: 32px !important;
  height: 32px !important;

  display: inline-flex !important;
  align-items: center;
  justify-content: center;

  border-radius: 50% !important;
  border: 1px solid rgba(0, 247, 255, 0.75) !important;

  background: linear-gradient(135deg, #00e5ff, #006eff) !important;
  color: #ffffff !important;

  font-size: 16px !important;
  font-weight: 900 !important;
  cursor: pointer;

  box-shadow:
    0 0 10px rgba(0, 229, 255, 0.45),
    0 0 18px rgba(0, 110, 255, 0.25);

  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-editar-cliente:hover {
  transform: scale(1.08);
  box-shadow:
    0 0 14px rgba(0, 229, 255, 0.75),
    0 0 26px rgba(0, 110, 255, 0.4);
}

/* Checkbox / badge de recordatorio queda en la izquierda */
.check-recordatorio-wrap {
  top: 12px !important;
  left: 14px !important;
  z-index: 9 !important;
}

/* Cuando no tiene tel¨¦fono */
.badge-sin-telefono,
.check-recordatorio-wrap.sin-telefono {
  top: 12px !important;
  left: 14px !important;
  z-index: 9 !important;
}

/* Evita que el valor se monte con acciones superiores */
.card-right {
  top: 58px !important;
}

/* En m¨®viles dejamos todav¨ªa m¨¢s aire */
@media (max-width: 480px) {
  .finance-card {
    padding-top: 68px !important;
  }

  .badge-alerta {
    font-size: 10px;
    padding: 4px 8px;
    max-width: 95px;
  }

  .btn-editar-cliente {
    top: 42px !important;
    right: 12px !important;
    width: 30px !important;
    height: 30px !important;
  }

  .card-right {
    top: 62px !important;
  }
}
/* =========================
   FIX FINAL L0†9PIZ SIN TAPAR SALDO
========================= */

/* Dejamos espacio normal arriba */
.finance-card {
  padding-top: 54px !important;
}

/* La alerta de deuda alta queda arriba derecha */
.badge-alerta {
  position: absolute !important;
  top: 12px !important;
  right: 12px !important;
  z-index: 8 !important;
}

/* El saldo queda libre arriba/derecha */
.card-right {
  position: absolute !important;
  top: 62px !important;
  right: 18px !important;
  z-index: 3 !important;
  width: 110px;
  text-align: right;
}

/* Mover l¨¢piz abajo a la derecha */
.btn-editar-cliente {
  position: absolute !important;
  right: 14px !important;
  bottom: 14px !important;
  top: auto !important;

  z-index: 12 !important;

  width: 30px !important;
  height: 30px !important;

  border-radius: 50% !important;
  border: 1px solid rgba(0, 247, 255, 0.75) !important;

  background: linear-gradient(135deg, #00e5ff, #006eff) !important;
  color: #ffffff !important;

  display: inline-flex !important;
  align-items: center;
  justify-content: center;

  font-size: 15px !important;
  font-weight: 900 !important;

  box-shadow:
    0 0 10px rgba(0, 229, 255, 0.45),
    0 0 18px rgba(0, 110, 255, 0.25);
}

/* Para que la barra de progreso no quede debajo del l¨¢piz */
.progress-bar {
  margin-right: 42px;
}

/* Checkbox o badge sin tel¨¦fono arriba izquierda */
.check-recordatorio-wrap,
.badge-sin-telefono,
.check-recordatorio-wrap.sin-telefono {
  top: 12px !important;
  left: 14px !important;
  z-index: 9 !important;
}

/* Ajuste m¨®vil */
@media (max-width: 480px) {
  .finance-card {
    padding-top: 56px !important;
  }

  .card-right {
    top: 62px !important;
    right: 18px !important;
  }

  .btn-editar-cliente {
    right: 14px !important;
    bottom: 14px !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
  }

  .progress-bar {
    margin-right: 40px;
  }
}


/* Badge visual para clientes que ya recibieron recordatorio WhatsApp */
.check-recordatorio-wrap.recordatorio-enviado {
  max-width: 118px;
  background: rgba(31, 157, 85, 0.95) !important;
  border-color: rgba(125, 255, 179, 0.65) !important;
  color: #ffffff !important;
  cursor: not-allowed !important;
  box-shadow: 0 0 12px rgba(31, 157, 85, 0.35);
}

.check-recordatorio-wrap.recordatorio-enviado span {
  font-weight: 700;
}


/* Estado visible: recordatorio ya enviado por WhatsApp */
.check-recordatorio-wrap.recordatorio-enviado {
  max-width: 145px !important;
  background: linear-gradient(135deg, #13b86f, #0a7f47) !important;
  border: 1px solid rgba(125, 255, 179, 0.95) !important;
  color: #ffffff !important;
  cursor: default !important;
  box-shadow: 0 0 14px rgba(19, 184, 111, 0.55) !important;
}

.check-recordatorio-wrap.recordatorio-enviado span {
  font-weight: 800 !important;
  letter-spacing: .2px;
}

/* =========================
   CONTADORES WHATSAPP
========================= */

.contadores-whatsapp {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.contador-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .2px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(0, 247, 255, 0.24);
  color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 14px rgba(0, 247, 255, 0.06);
}

.contador-pill strong {
  min-width: 28px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
}

.contador-seleccionados {
  border-color: rgba(0, 229, 255, 0.42);
}

.contador-seleccionados strong {
  color: #00f7ff;
}

.contador-enviados {
  border-color: rgba(125, 255, 179, 0.42);
}

.contador-enviados strong {
  color: #7dffb3;
}

.contador-icon {
  line-height: 1;
}

@media (max-width: 768px) {
  .contadores-whatsapp {
    justify-content: center;
  }

  .contador-pill {
    width: 100%;
    justify-content: space-between;
  }
}


/* =========================
   PROGRESO ENVIO WHATSAPP
========================= */

.whatsapp-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
}

.whatsapp-progress-overlay.visible {
  display: flex;
}

.whatsapp-progress-modal {
  width: min(94vw, 520px);
  border-radius: 24px;
  padding: 28px 24px;
  text-align: center;
  background: linear-gradient(145deg, #101c2d, #08101a);
  border: 1px solid rgba(0, 247, 255, 0.22);
  box-shadow: 0 0 28px rgba(0, 247, 255, 0.16), 0 0 80px rgba(0, 0, 0, 0.45);
}

.whatsapp-progress-icon {
  width: 62px;
  height: 62px;
  margin: 0 auto 10px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: rgba(0, 247, 255, 0.1);
  border: 1px solid rgba(0, 247, 255, 0.35);
  box-shadow: 0 0 18px rgba(0, 247, 255, 0.18);
}

.whatsapp-progress-modal h2 {
  margin: 0 0 8px;
  color: #fff;
}

.whatsapp-progress-modal p {
  margin: 0 0 16px;
  color: rgba(255, 255, 255, 0.72);
}

.whatsapp-progress-bar {
  width: 100%;
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.whatsapp-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00f7ff, #1788ff, #ff7dfc);
  transition: width 0.25s ease;
}

.whatsapp-progress-percent {
  margin-top: 12px;
  font-size: 2rem;
  font-weight: 900;
  color: #00f7ff;
  text-shadow: 0 0 14px rgba(0, 247, 255, 0.35);
}

.whatsapp-progress-detail {
  margin-top: 12px;
  padding: 12px;
  border-radius: 16px;
  text-align: left;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
  line-height: 1.45;
}

.whatsapp-progress-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.whatsapp-progress-stats span {
  padding: 7px 8px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.btn-cerrar-whatsapp-progress {
  display: none;
  align-items: center;
  justify-content: center;
  margin-top: 18px;
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  color: #001018;
  background: linear-gradient(90deg, #00f7ff, #ff7dfc);
}

@media (max-width: 520px) {
  .whatsapp-progress-stats {
    grid-template-columns: 1fr;
  }
}

/* Modal elegante para confirmar y monitorear env0‡10…2os de WhatsApp */
.whatsapp-confirm-overlay,
.whatsapp-progress-overlay {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background:
    radial-gradient(circle at top left, rgba(0, 247, 255, 0.16), transparent 34%),
    radial-gradient(circle at bottom right, rgba(255, 125, 252, 0.13), transparent 34%),
    rgba(2, 9, 18, 0.84);
  backdrop-filter: blur(10px);
}

.whatsapp-confirm-overlay.visible,
.whatsapp-progress-overlay.visible {
  display: flex;
  animation: pasnetFadeIn .18s ease-out;
}

.whatsapp-confirm-modal,
.whatsapp-progress-modal {
  position: relative;
  width: min(94vw, 540px);
  overflow: hidden;
  border-radius: 26px;
  padding: 26px;
  color: #f8fdff;
  background:
    linear-gradient(145deg, rgba(14, 27, 45, 0.98), rgba(5, 13, 24, 0.98));
  border: 1px solid rgba(0, 247, 255, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 70px rgba(0, 0, 0, 0.52),
    0 0 42px rgba(0, 247, 255, 0.16);
  animation: pasnetScaleIn .2s ease-out;
}

.whatsapp-confirm-glow,
.whatsapp-progress-topline {
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, #00f7ff, #29a8ff, #ff7dfc);
  box-shadow: 0 0 22px rgba(0, 247, 255, 0.65);
}

.whatsapp-confirm-header,
.whatsapp-progress-header {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  margin-bottom: 18px;
}

.whatsapp-confirm-icon,
.whatsapp-progress-icon {
  flex: 0 0 auto;
  width: 62px;
  height: 62px;
  margin: 0;
  border-radius: 20px;
  display: grid;
  place-items: center;
  font-size: 30px;
  background:
    linear-gradient(145deg, rgba(0, 247, 255, 0.18), rgba(255, 125, 252, 0.10));
  border: 1px solid rgba(0, 247, 255, 0.35);
  box-shadow: 0 0 22px rgba(0, 247, 255, 0.18);
}

.whatsapp-confirm-modal h2,
.whatsapp-progress-modal h2 {
  margin: 0 0 4px;
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  line-height: 1.15;
  color: #ffffff;
}

.whatsapp-confirm-modal p,
.whatsapp-progress-modal p {
  margin: 0;
  color: rgba(235, 247, 255, 0.74);
  line-height: 1.45;
}

.whatsapp-confirm-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 12px;
}

.whatsapp-confirm-summary > div {
  padding: 14px;
  border-radius: 18px;
  text-align: left;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.summary-label {
  display: block;
  margin-bottom: 4px;
  font-size: .78rem;
  color: rgba(235, 247, 255, 0.64);
}

.whatsapp-confirm-summary strong {
  font-size: 1.45rem;
  color: #00f7ff;
  text-shadow: 0 0 12px rgba(0, 247, 255, 0.24);
}

.whatsapp-confirm-note {
  padding: 12px 14px;
  border-radius: 16px;
  text-align: left;
  background: rgba(0, 247, 255, 0.07);
  border: 1px solid rgba(0, 247, 255, 0.14);
}

.whatsapp-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.btn-whatsapp-secondary,
.btn-whatsapp-primary,
.btn-cerrar-whatsapp-progress {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 900;
  border: 1px solid transparent;
}

.btn-whatsapp-secondary {
  color: #e9faff;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
}

.btn-whatsapp-primary,
.btn-cerrar-whatsapp-progress {
  color: #001018;
  background: linear-gradient(90deg, #00f7ff, #29a8ff, #ff7dfc);
  box-shadow: 0 0 18px rgba(0, 247, 255, 0.22);
}

.whatsapp-progress-meter {
  display: grid;
  grid-template-columns: 86px 1fr;
  align-items: center;
  gap: 14px;
  margin: 18px 0 14px;
}

.whatsapp-progress-percent {
  margin: 0;
  font-size: 2rem;
  font-weight: 950;
  color: #00f7ff;
  text-align: left;
  text-shadow: 0 0 14px rgba(0, 247, 255, 0.38);
}

.whatsapp-progress-bar {
  position: relative;
  width: 100%;
  height: 18px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.10);
}

.whatsapp-progress-fill {
  position: relative;
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00f7ff, #1788ff, #ff7dfc);
  transition: width 0.28s ease;
  box-shadow: 0 0 18px rgba(0, 247, 255, 0.42);
}

.whatsapp-progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.45), transparent);
  transform: translateX(-100%);
  animation: pasnetProgressShine 1.35s linear infinite;
}

.whatsapp-progress-detail {
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  text-align: left;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.92rem;
  line-height: 1.5;
}

.whatsapp-progress-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.whatsapp-progress-stats span {
  padding: 9px 8px;
  border-radius: 14px;
  text-align: center;
  background: rgba(0, 0, 0, 0.22);
  white-space: nowrap;
  font-size: .82rem;
}

.btn-cerrar-whatsapp-progress {
  display: none;
  margin: 20px auto 0;
}

@keyframes pasnetFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pasnetScaleIn {
  from { transform: translateY(8px) scale(.98); opacity: .75; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes pasnetProgressShine {
  to { transform: translateX(100%); }
}

@media (max-width: 620px) {
  .whatsapp-confirm-header,
  .whatsapp-progress-header {
    align-items: flex-start;
  }

  .whatsapp-confirm-summary,
  .whatsapp-progress-stats {
    grid-template-columns: 1fr 1fr;
  }

  .whatsapp-progress-meter {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .whatsapp-progress-percent {
    text-align: center;
  }
}

@media (max-width: 430px) {
  .whatsapp-confirm-modal,
  .whatsapp-progress-modal {
    padding: 22px 18px;
  }

  .whatsapp-confirm-summary,
  .whatsapp-progress-stats {
    grid-template-columns: 1fr;
  }

  .whatsapp-confirm-actions {
    flex-direction: column-reverse;
  }

  .btn-whatsapp-secondary,
  .btn-whatsapp-primary {
    width: 100%;
  }
}

/* =========================
   MEJORA FINAL: FILTROS, CARDS Y ACCIONES
========================= */

/* Filtros nuevos: mensajes enviados, no enviados y sin tel0‡10„8fono */
.filtros-clientes .filtro-btn[data-filtro="enviados"],
.filtros-clientes .filtro-btn[data-filtro="no_enviados"],
.filtros-clientes .filtro-btn[data-filtro="sin_telefono"] {
  min-width: auto;
}

/* Cards m0‡10„3s limpias en PC: similar al comportamiento m0‡10…6vil, sin nombres partidos en columnas estrechas */
#listaClientes.cards {
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  align-items: stretch;
}

.finance-card {
  min-height: 190px;
  padding: 58px 18px 18px !important;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.finance-card .card-left {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 118px;
  column-gap: 14px;
  align-items: start;
  padding-right: 0 !important;
  width: 100%;
}

.finance-card .card-left > div:last-child {
  min-width: 0;
}

.finance-card h3 {
  max-width: 100%;
  font-size: 1.02rem;
  line-height: 1.22;
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none;
}

.finance-card .card-right {
  position: static !important;
  grid-column: 3;
  grid-row: 1 / span 4;
  width: auto !important;
  min-width: 110px;
  text-align: right;
  z-index: 3 !important;
  align-self: start;
}

.finance-card .card-right h2 {
  font-size: 1.18rem;
}

.finance-card .progress-bar {
  margin-top: 18px;
  margin-right: 46px;
}

/* Bot0‡10…6n para ocultar/eliminar visualmente la card del cliente */
.btn-eliminar-card {
  position: absolute !important;
  right: 52px !important;
  bottom: 14px !important;
  top: auto !important;
  z-index: 12 !important;
  width: 30px !important;
  height: 30px !important;
  border-radius: 50% !important;
  border: 1px solid rgba(255, 86, 119, 0.75) !important;
  background: linear-gradient(135deg, #ff4778, #b00035) !important;
  color: #ffffff !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 14px !important;
  cursor: pointer;
  box-shadow:
    0 0 10px rgba(255, 71, 120, 0.42),
    0 0 18px rgba(176, 0, 53, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-eliminar-card:hover {
  transform: scale(1.08);
  box-shadow:
    0 0 14px rgba(255, 71, 120, 0.72),
    0 0 26px rgba(176, 0, 53, 0.35);
}

/* El modal personalizado tambi0‡10„8n se usa para avisos/confirmaciones, no alertas del navegador */
.whatsapp-confirm-overlay.is-warning .whatsapp-confirm-modal {
  border-color: rgba(255, 197, 61, 0.36);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 24px 70px rgba(0, 0, 0, 0.52),
    0 0 42px rgba(255, 197, 61, 0.14);
}

.whatsapp-confirm-overlay.is-warning .whatsapp-confirm-glow {
  background: linear-gradient(90deg, #ffc53d, #ff7a18, #ff4778);
}

.whatsapp-confirm-overlay.is-success .whatsapp-confirm-glow {
  background: linear-gradient(90deg, #00ff99, #00f7ff, #29a8ff);
}

.whatsapp-confirm-overlay.is-error .whatsapp-confirm-glow {
  background: linear-gradient(90deg, #ff4778, #ff2d55, #ff7a18);
}

@media (min-width: 1100px) {
  #listaClientes.cards {
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  }
}

@media (max-width: 720px) {
  #listaClientes.cards {
    grid-template-columns: 1fr;
  }

  .finance-card {
    min-height: 0;
  }

  .finance-card .card-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .finance-card .card-right {
    width: 100% !important;
    min-width: 0;
    text-align: left;
    margin-top: 8px;
  }

  .finance-card .progress-bar {
    margin-right: 46px;
  }
}

/* Correcci0‡10…6n de estructura nueva de card */
.finance-card .card-main-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 118px;
  column-gap: 14px;
  align-items: start;
  width: 100%;
}

.finance-card .card-info {
  min-width: 0;
}

.finance-card .card-main-row .card-right {
  position: static !important;
  width: auto !important;
  min-width: 110px;
  text-align: right;
  align-self: start;
}

@media (max-width: 720px) {
  .finance-card .card-main-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .finance-card .card-main-row .card-right {
    width: 100% !important;
    min-width: 0;
    text-align: left;
    margin-top: 8px;
  }
}


/* =====================================================
   AJUSTE FINAL: contador flotante + acciones sobre barra
   ===================================================== */

/* No dejamos el encabezado fijo. El contador flotante resuelve el seguimiento al seleccionar. */
.clientes-header {
  position: static !important;
  top: auto !important;
  z-index: auto !important;
  backdrop-filter: none !important;
}

.contador-flotante-seleccionados {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%) translateY(18px) scale(.96);
  z-index: 9999;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(4, 16, 28, .96), rgba(7, 31, 48, .96));
  border: 1px solid rgba(0, 247, 255, .52);
  color: #ffffff;
  font-weight: 800;
  letter-spacing: .2px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.04) inset,
    0 12px 30px rgba(0,0,0,.45),
    0 0 20px rgba(0,247,255,.20),
    0 0 34px rgba(184,92,255,.12);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.contador-flotante-seleccionados.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.contador-flotante-seleccionados strong {
  min-width: 34px;
  text-align: center;
  padding: 3px 10px;
  border-radius: 999px;
  color: #00131c;
  background: linear-gradient(135deg, #00f7ff, #d96bff);
  box-shadow: 0 0 14px rgba(0,247,255,.34);
}

.contador-flotante-seleccionados.pulse strong {
  animation: contadorSeleccionPulse .28s ease;
}

@keyframes contadorSeleccionPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

/* Mantener la barra de progreso abajo y libre; las acciones quedan encima. */
.finance-card {
  padding-bottom: 22px !important;
}

.finance-card .progress-bar,
.progress-bar {
  margin-right: 0 !important;
  position: relative !important;
  z-index: 1 !important;
}

.btn-editar-cliente,
.btn-eliminar-card {
  bottom: 46px !important;
  top: auto !important;
  z-index: 15 !important;
}

.btn-editar-cliente {
  right: 14px !important;
}

.btn-eliminar-card {
  right: 52px !important;
}

@media (max-width: 720px) {
  .contador-flotante-seleccionados {
    bottom: 14px;
    width: calc(100% - 30px);
    max-width: 360px;
    justify-content: center;
    padding: 11px 14px;
  }

  .btn-editar-cliente,
  .btn-eliminar-card {
    bottom: 44px !important;
  }
}

/* Edici0‡10…6n r0‡10„3pida de plan dentro del modal de pago */
.pago-resumen-box {
  margin-bottom: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 245, 255, .16);
  border-radius: 16px;
  background: rgba(4, 12, 28, .32);
}

.pago-resumen-box p {
  margin: 7px 0;
}

.plan-edit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-mini-plan {
  border: 1px solid rgba(0, 245, 255, .55);
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(0, 245, 255, .08);
  color: #bffcff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 245, 255, .12);
}

.btn-mini-plan:hover {
  background: rgba(0, 245, 255, .18);
  box-shadow: 0 0 18px rgba(0, 245, 255, .24);
}

.editar-plan-box {
  margin: 10px 0 12px;
  padding: 12px;
  border: 1px solid rgba(125, 255, 179, .22);
  border-radius: 14px;
  background: rgba(9, 35, 44, .52);
}

.editar-plan-box[hidden] {
  display: none !important;
}

.editar-plan-box label {
  display: block;
  margin-bottom: 8px;
  color: #d7fff0;
  font-size: .9rem;
  font-weight: 800;
}

.editar-plan-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.editar-plan-actions input {
  margin: 0 !important;
}

.editar-plan-actions button {
  min-width: 126px;
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  background: linear-gradient(135deg, #27f3ff, #f06dff);
  color: #03111e;
  font-weight: 900;
  cursor: pointer;
}

.editar-plan-actions button:disabled {
  opacity: .65;
  cursor: wait;
}

.editar-plan-box small {
  display: block;
  margin-top: 8px;
  color: rgba(230, 245, 255, .72);
}

@media (max-width: 520px) {
  .editar-plan-actions {
    grid-template-columns: 1fr;
  }

  .editar-plan-actions button {
    width: 100%;
  }
}

/* =====================================================
   AJUSTE MANUAL DE DEUDA DESDE MODAL DE PAGO
   ===================================================== */
.btn-mini-deuda {
  border-color: rgba(255, 197, 61, .62) !important;
  background: rgba(255, 197, 61, .10) !important;
  color: #ffe8a8 !important;
  box-shadow: 0 0 14px rgba(255, 197, 61, .12) !important;
}

.btn-mini-deuda:hover {
  background: rgba(255, 197, 61, .18) !important;
  box-shadow: 0 0 18px rgba(255, 197, 61, .24) !important;
}

.ajustar-deuda-box {
  border-color: rgba(255, 197, 61, .28) !important;
  background: rgba(43, 31, 9, .46) !important;
}

.ajustar-deuda-box label {
  color: #fff1c4 !important;
}

.ajustar-deuda-box .editar-plan-actions button {
  background: linear-gradient(135deg, #ffd166, #f06dff) !important;
  color: #17110a !important;
}

#valorSaldoPendienteActual {
  color: #ff75ff;
  font-weight: 900;
}

#valorDeudaAnteriorActual,
#valorTotalDeudaActual,
#valorPlanActual {
  color: #ffffff;
  font-weight: 900;
}

/* =====================================================
   NO ENTREGADOS TWILIO
   ===================================================== */
.filtros-clientes .filtro-btn[data-filtro="no_entregados"],
.filtros-clientes .btn-sync-twilio {
  min-width: auto;
}

.check-recordatorio-wrap.recordatorio-no-entregado {
  max-width: 160px !important;
  background: linear-gradient(135deg, #ff3b5c, #8f1532) !important;
  border: 1px solid rgba(255, 144, 160, 0.95) !important;
  color: #ffffff !important;
  cursor: help !important;
  box-shadow: 0 0 14px rgba(255, 59, 92, 0.55) !important;
}

.check-recordatorio-wrap.recordatorio-no-entregado span {
  font-weight: 800 !important;
  letter-spacing: .2px;
}

.contador-no-entregados {
  border-color: rgba(255, 89, 120, 0.50);
}

.contador-no-entregados strong {
  color: #ff7f96;
}

.btn-sync-twilio {
  border-color: rgba(0, 247, 255, 0.35) !important;
  color: #bffcff !important;
}

.btn-sync-twilio:disabled {
  opacity: .65;
  cursor: wait;
}

/* Badge para clientes instalados dentro de los 0‡10†2ltimos 7 d0‡10…2as del mes.
   No se cobra el mes de instalaci0‡10…6n y no se permite recordatorio WhatsApp. */
.check-recordatorio-wrap.cliente-nuevo {
  max-width: 118px !important;
  background: linear-gradient(135deg, #26e6ff, #e66bff) !important;
  border: 1px solid rgba(255,255,255,.72) !important;
  color: #ffffff !important;
  cursor: default !important;
  box-shadow: 0 0 16px rgba(38, 230, 255, .45), 0 0 18px rgba(230, 107, 255, .22) !important;
}

.check-recordatorio-wrap.cliente-nuevo span {
  font-weight: 900 !important;
  letter-spacing: .25px;
  text-transform: uppercase;
}


/* Etiqueta NEW para clientes nuevos con cobro proporcional. No bloquea el recordatorio. */
.badge-new-card {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  color: #04120a;
  background: linear-gradient(135deg, #9dffb3, #33ff8a);
  border: 1px solid rgba(157, 255, 179, 0.8);
  box-shadow: 0 0 14px rgba(51, 255, 138, 0.35);
  pointer-events: auto;
}

.finance-card .badge-new-card + .check-recordatorio-wrap,
.finance-card .badge-new-card ~ .check-recordatorio-wrap {
  right: 14px;
}

/* Integraci0‡10…6n MikroTik PPPoE */
.estado-servicio-pill {
  display:inline-flex;
  align-items:center;
  gap:6px;
  width:max-content;
  max-width:100%;
  padding:4px 9px;
  border-radius:999px;
  font-size:.72rem;
  font-weight:800;
  margin:24px 0 8px;
  border:1px solid rgba(0,255,255,.28);
  background:rgba(5,15,25,.72);
  box-shadow:0 0 12px rgba(0,255,255,.12);
}
.estado-servicio-pill.servicio-activo { color:#72ffb1; border-color:rgba(67,255,158,.35); }
.estado-servicio-pill.servicio-suspendido { color:#ff6f8a; border-color:rgba(255,80,120,.45); box-shadow:0 0 14px rgba(255,43,96,.22); }
.estado-servicio-pill.servicio-promesa { color:#ffe07a; border-color:rgba(255,210,60,.45); box-shadow:0 0 14px rgba(255,196,0,.14); }
.cliente-pppoe { font-size:.76rem; opacity:.88; margin:.15rem 0; color:#bfefff; }
.cliente-pppoe.pppoe-vacio { color:#ffb3bd; font-weight:700; }
.mikrotik-control-box {
  margin:12px 0 16px;
  padding:14px;
  border:1px solid rgba(0,255,255,.22);
  border-radius:16px;
  background:rgba(2,14,26,.55);
}
.mikrotik-control-head {
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:flex-start;
  margin-bottom:12px;
}
.mikrotik-control-head small {
  display:block;
  margin-top:4px;
  opacity:.75;
}
.mikrotik-actions {
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.btn-mikro {
  border:1px solid rgba(0,255,255,.24);
  border-radius:999px;
  padding:9px 12px;
  font-weight:800;
  cursor:pointer;
  background:rgba(5,18,33,.9);
  color:#eaffff;
}
.btn-mikro-info { color:#80dcff; }
.btn-mikro-suspender { color:#ff7b96; border-color:rgba(255,50,95,.35); }
.btn-mikro-reactivar { color:#75ffb1; border-color:rgba(60,255,150,.35); }
.btn-mikro-promesa { color:#ffe077; border-color:rgba(255,205,55,.35); }
.mikrotik-resultado {
  margin-top:10px;
  font-size:.88rem;
  color:#c8f7ff;
  opacity:.95;
}

@media (max-width: 720px) {
  .estado-servicio-pill { margin-top:18px; font-size:.68rem; padding:4px 8px; }
  .mikrotik-control-head { flex-direction:column; }
  .mikrotik-actions { display:grid; grid-template-columns:1fr 1fr; }
  .btn-mikro { padding:9px 8px; font-size:.82rem; }
}

.promesa-actual-box {
  border: 1px solid rgba(255, 211, 77, .35);
  background: rgba(255, 211, 77, .08);
  color: #ffe48a;
  padding: 10px 12px;
  border-radius: 14px;
  margin: 10px 0 14px;
  line-height: 1.4;
}

.promesa-actions-modal {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

@media (max-width: 640px) {
  .promesa-actions-modal .btn-mikro {
    flex: 1 1 100%;
    justify-content: center;
  }
}

/* Promesas visibles dentro del modal de pago */
.promesa-resumen-inline {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 214, 64, .35);
  border-radius: 14px;
  background: rgba(255, 214, 64, .08);
  color: #ffe58a;
  font-weight: 700;
}
.promesa-resumen-inline small {
  display: inline-block;
  margin-top: 4px;
  color: rgba(255,255,255,.72);
  font-weight: 600;
}
.promesa-actions-modal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
@media (max-width: 640px) {
  .mikrotik-actions .btn-mikro {
    min-height: 38px;
    font-size: .78rem;
  }
  .promesa-resumen-inline {
    font-size: .82rem;
  }
}


.promesa-warning-inline {
  border-color: rgba(255, 193, 7, .55) !important;
  background: rgba(255, 193, 7, .10) !important;
  color: #ffe08a !important;
}


@media (max-width: 768px) {
  .clientes-mobile-toolbar {
    display: flex;
  }

  .clientes-mobile-menu {
    display: none;
    width: 100%;
    border: 1px solid rgba(0, 247, 255, 0.18);
    border-radius: 18px;
    padding: 12px;
    background: linear-gradient(145deg, rgba(9, 18, 32, 0.98), rgba(5, 12, 20, 0.98));
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.28), 0 0 18px rgba(0, 247, 255, 0.08);
  }

  .clientes-mobile-menu.open {
    display: block;
    animation: menuClientesSlideDown .22s ease;
  }

  .clientes-mobile-menu .filtros-clientes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    justify-content: stretch;
  }

  .clientes-mobile-menu .filtro-btn,
  .clientes-mobile-menu .btn-volver-icon {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 14px;
  }

  .contadores-whatsapp {
    gap: 8px;
    justify-content: stretch;
  }

  .contador-pill {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 0;
    width: auto;
    justify-content: center;
    padding: 8px 10px;
    gap: 6px;
  }

  .contador-pill span:not(.contador-icon) {
    display: none;
  }

  .contador-pill strong {
    min-width: 0;
    padding: 2px 7px;
    font-size: 12px;
  }
}

@keyframes menuClientesSlideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =====================================================
   MEN0‰3 HAMBURGUESA REAL PARA COBRANZA
   Oculta filtros/acciones hasta presionar el bot¨®n.
===================================================== */
.clientes-header {
  position: relative;
}

.clientes-mobile-toolbar {
  display: flex !important;
  width: 100%;
  order: 3;
}

.btn-menu-clientes {
  width: 100%;
  max-width: 360px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 1px solid rgba(0, 247, 255, 0.42);
  background: linear-gradient(135deg, rgba(0, 247, 255, .16), rgba(255, 123, 255, .14));
  color: #ffffff;
  font-weight: 800;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 247, 255, 0.10);
}

.btn-menu-clientes::before {
  content: '';
}

.btn-menu-clientes.is-open {
  border-color: rgba(255, 123, 255, 0.62);
  box-shadow: 0 0 22px rgba(255, 123, 255, 0.16);
}

.clientes-mobile-menu {
  display: none !important;
  width: 100%;
  order: 4;
  margin-top: 2px;
  border: 1px solid rgba(0, 247, 255, 0.20);
  border-radius: 20px;
  padding: 14px;
  background: linear-gradient(145deg, rgba(8, 17, 30, 0.98), rgba(4, 10, 18, 0.98));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.30), 0 0 24px rgba(0, 247, 255, 0.08);
}

.clientes-mobile-menu.open {
  display: block !important;
  animation: menuClientesSlideDown .22s ease;
}

.clientes-mobile-menu .filtros-clientes {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  width: 100%;
}

.clientes-mobile-menu .filtro-btn,
.clientes-mobile-menu .btn-volver-icon {
  width: 100%;
  min-width: 0;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 12px;
  border-radius: 14px;
  white-space: nowrap;
}

.clientes-header .contadores-whatsapp {
  order: 5;
}

@media (min-width: 769px) {
  .clientes-header {
    align-items: center;
  }

  #buscadorClientes {
    flex: 1 1 520px;
  }

  .select-filtro-direccion {
    flex: 0 0 320px;
  }

  .clientes-mobile-toolbar {
    flex: 0 0 auto;
    width: auto;
  }

  .btn-menu-clientes {
    width: auto;
    min-width: 250px;
  }
}

@media (max-width: 768px) {
  .clientes-mobile-toolbar {
    order: 2;
  }

  .clientes-mobile-menu {
    order: 3;
    padding: 12px;
  }

  .clientes-mobile-menu .filtros-clientes {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .clientes-mobile-menu .filtro-btn,
  .clientes-mobile-menu .btn-volver-icon {
    min-height: 38px;
    height: auto;
    font-size: 12px;
    padding: 9px 8px;
  }

  #btnEnviarRecordatoriosSeleccionados {
    grid-column: 1 / -1;
  }
}

@media (max-width: 420px) {
  .clientes-mobile-menu .filtros-clientes {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   MENU HAMBURGUESA REAL - COBRANZA
   Fuerza a ocultar filtros/acciones hasta abrir el menu.
========================================================= */
.clientes-menu-shell {
  flex: 1 1 100%;
  width: 100%;
  position: relative;
  z-index: 50;
}

.btn-menu-clientes {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 230px;
  padding: 10px 16px;
  border-radius: 18px;
  border: 1px solid rgba(0, 247, 255, 0.42);
  background: linear-gradient(90deg, rgba(0, 247, 255, 0.16), rgba(255, 123, 255, 0.14));
  color: #ffffff;
  font-weight: 800;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 247, 255, 0.10);
}

.btn-menu-clientes.is-open {
  border-color: rgba(255, 123, 255, 0.65);
  box-shadow: 0 0 22px rgba(255, 123, 255, 0.16);
}

.clientes-mobile-menu {
  display: none !important;
  width: min(720px, 100%);
  margin-top: 10px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(0, 247, 255, 0.22);
  background: linear-gradient(145deg, rgba(7, 15, 26, 0.98), rgba(3, 10, 17, 0.98));
  box-shadow: 0 18px 35px rgba(0, 0, 0, .34), 0 0 22px rgba(0, 247, 255, .08);
}

.clientes-mobile-menu.open {
  display: block !important;
  animation: menuClientesSlideDown .18s ease-out;
}

.clientes-menu-shell .filtros-clientes {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
  width: 100%;
}

.clientes-menu-shell .filtro-btn,
.clientes-menu-shell .btn-volver-icon {
  width: 100%;
  min-width: 0 !important;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 14px;
  white-space: normal;
  text-align: left;
}

@media (max-width: 768px) {
  .clientes-header {
    position: sticky;
    top: 0;
    z-index: 90;
    padding: 12px 10px;
    margin: 0 0 12px;
    background: rgba(3, 10, 17, 0.96);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 247, 255, 0.12);
  }

  .btn-menu-clientes {
    width: 100%;
    min-width: 0;
  }

  .clientes-mobile-menu {
    width: 100%;
    max-height: 62vh;
    overflow-y: auto;
  }

  .clientes-menu-shell .filtros-clientes {
    grid-template-columns: 1fr;
  }

  .contadores-whatsapp {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .contador-pill {
    width: auto !important;
    min-width: 0;
    justify-content: center;
    padding: 8px 6px;
  }

  .contador-pill span:not(.contador-icon) {
    display: none;
  }
}

@keyframes menuClientesSlideDown {
  from { opacity: 0; transform: translateY(-7px); }
  to { opacity: 1; transform: translateY(0); }
}


/* =========================================================
   MENU HAMBURGUESA REAL - VERSION SIN JAVASCRIPT
   Usa <details>/<summary>, por eso abre aunque falle clientes.js.
========================================================= */
.clientes-header {
  align-items: flex-start;
}

.clientes-menu-shell {
  flex: 1 1 100%;
  width: 100%;
  max-width: 980px;
  margin-top: 4px;
  position: relative;
  z-index: 20;
}

.clientes-menu-shell > summary.btn-menu-clientes {
  list-style: none;
  width: max-content;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid rgba(0, 247, 255, 0.45);
  background: linear-gradient(135deg, rgba(3, 25, 35, 0.98), rgba(10, 31, 50, 0.98));
  color: #ffffff;
  font-weight: 800;
  letter-spacing: .2px;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(0, 247, 255, 0.08);
  user-select: none;
}

.clientes-menu-shell > summary.btn-menu-clientes::-webkit-details-marker {
  display: none;
}

.clientes-menu-shell[open] > summary.btn-menu-clientes {
  background: linear-gradient(90deg, rgba(0, 247, 255, .24), rgba(255, 123, 255, .20));
  border-color: rgba(255, 123, 255, .45);
}

.clientes-menu-shell > .clientes-mobile-menu {
  display: none !important;
}

.clientes-menu-shell[open] > .clientes-mobile-menu {
  display: block !important;
  margin-top: 12px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(0, 247, 255, 0.22);
  background: linear-gradient(145deg, rgba(8, 16, 28, 0.98), rgba(4, 11, 20, 0.98));
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.36), 0 0 22px rgba(0, 247, 255, 0.08);
  animation: menuClientesSlideDown .18s ease-out;
}

.clientes-menu-shell .filtros-clientes {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  width: 100%;
}

.clientes-menu-shell .filtro-btn,
.clientes-menu-shell .btn-volver-icon {
  width: 100%;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  white-space: normal;
  text-align: left;
}

@media (max-width: 768px) {
  .clientes-menu-shell {
    max-width: 100%;
  }

  .clientes-menu-shell > summary.btn-menu-clientes {
    width: 100%;
  }

  .clientes-menu-shell .filtros-clientes {
    grid-template-columns: 1fr !important;
  }
}


/* Acceso claro al importador de pagos */
.btn-importar-pagos,
.btn-importar-pagos-destacado {
  border-color: rgba(125, 255, 179, 0.45) !important;
  color: #7dffb3 !important;
}

.acciones-excel-rapidas {
  max-width: 760px;
  margin: 18px auto 12px;
  display: flex;
  justify-content: center;
}

.btn-importar-pagos-destacado {
  padding: 12px 20px;
  border-radius: 18px;
  background: linear-gradient(90deg, rgba(0,247,255,.2), rgba(125,255,179,.18));
  border: 1px solid rgba(125, 255, 179, 0.45);
  color: #ffffff !important;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(125, 255, 179, 0.08);
}

.nota-importar-clientes {
  color: rgba(255,255,255,.62);
  font-size: 13px;
  margin: -4px 0 12px;
}


/* Bot¨®n para limpiar todos los filtros de cobranza */
.btn-limpiar-filtros {
  border-color: rgba(255, 217, 102, 0.55) !important;
  color: #ffe486 !important;
  background: rgba(255, 217, 102, 0.08) !important;
  font-weight: 800;
}

.btn-limpiar-filtros:hover {
  background: rgba(255, 217, 102, 0.16) !important;
  box-shadow: 0 0 16px rgba(255, 217, 102, 0.18);
}

.clientes-menu-shell .btn-limpiar-filtros {
  order: -10;
}


/* =========================
   IMPORTAR CLIENTES - MOBILE
========================= */

.bloque-importar-clientes {
  margin-top: 24px;
}

.separador-importar-clientes {
  margin-top: 14px;
}

@media (max-width: 768px) {
  .bloque-importar-clientes,
  .separador-importar-clientes {
    display: none !important;
  }
}

/* =========================
   RESUMEN COBRANZA - MOBILE
   En celular solo se muestra Total cobrado hoy
========================= */
@media (max-width: 768px) {
  .resumen-grid .resumen-card:not(:first-child),
  .acciones-excel-rapidas {
    display: none !important;
  }

  .resumen-grid {
    grid-template-columns: 1fr !important;
    max-width: 100%;
    margin-top: 14px;
  }

  .resumen-grid .resumen-card:first-child {
    min-height: 112px;
  }
}


/* =========================================================
   MOBILE: EVITAR ZOOM ACCIDENTAL EN INPUTS/BOTONES
   ========================================================= */
@media (max-width: 768px) {
  html,
  body {
    touch-action: manipulation;
    overscroll-behavior: none;
  }

  input,
  select,
  textarea,
  button {
    font-size: 16px !important;
  }
}


.btn-seleccionar-filtrados {
  border-color: rgba(34, 197, 94, .55) !important;
  background: linear-gradient(135deg, rgba(34, 197, 94, .18), rgba(16, 185, 129, .12)) !important;
}

.btn-limpiar-seleccion {
  border-color: rgba(251, 146, 60, .55) !important;
  background: linear-gradient(135deg, rgba(251, 146, 60, .16), rgba(239, 68, 68, .10)) !important;
}
