*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', sans-serif;
  background: #f0f2f5;
  color: #333;
  min-height: 100vh;
}

/* NAVBAR */
.navbar {
  background: #1a73e8;
  color: #fff;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.navbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { font-size: 1.2rem; font-weight: 700; letter-spacing: .5px; }
.tabs { display: flex; gap: 4px; }
.tab {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.75);
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: .95rem;
  transition: background .2s, color .2s;
}
.tab:hover { background: rgba(255,255,255,.15); color: #fff; }
.tab.active { background: rgba(255,255,255,.25); color: #fff; font-weight: 600; }

/* LAYOUT CON MENÚ LATERAL */
.app-layout { display: flex; align-items: stretch; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #1a73e8;
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  box-shadow: 2px 0 8px rgba(0,0,0,.12);
}
.sidebar-brand {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: .5px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.18);
  margin-bottom: 12px;
}
.sidebar-brand i { font-size: 1.4rem; }
.sidebar-menu { display: flex; flex-direction: column; gap: 4px; padding: 0 10px; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  color: #e8eefc;
  font-size: .95rem;
  padding: 11px 14px;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background .15s, color .15s;
}
.sidebar-item i { font-size: 1.25rem; }
.sidebar-item:hover { background: rgba(255,255,255,.14); color: #fff; }
.sidebar-item.active { background: #fff; color: #1a73e8; font-weight: 600; }
.app-content { flex: 1; min-width: 0; }

/* PANEL DE NOTIFICACIONES (derecha en el detalle) — ocupa el ancho restante */
.notif-panel {
  flex: 1 1 300px;
  min-width: 260px;
  align-self: stretch;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  padding: 16px 14px;
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: .95rem;
  font-weight: 700;
  color: #333;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  margin-bottom: 12px;
}
.notif-header i { color: #1a73e8; }
.notif-count {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #e53935;
  color: #fff;
  font-size: .78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-filtros { display: flex; flex-direction: row; gap: 8px; margin-bottom: 12px; }
.notif-filtros input,
.notif-filtros select {
  padding: 8px 10px;
  border: 1px solid #d5d9e0;
  border-radius: 8px;
  font-size: .82rem;
  background: #fff;
  min-width: 0;
}
.notif-filtros input { flex: 1 1 auto; }
.notif-filtros select { flex: 0 0 auto; max-width: 42%; }
.notif-filtros input:focus,
.notif-filtros select:focus { outline: none; border-color: #1a73e8; }
.notif-lista { display: flex; flex-direction: column; gap: 8px; }
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  text-align: left;
  background: #f9fafb;
  border: 1px solid #eceff1;
  border-left: 3px solid #e53935;
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
  transition: background .15s;
}
.notif-item:hover { background: #f1f3f5; }
.notif-item-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffebee;
  color: #e53935;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.notif-item-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.notif-item-titulo { font-size: .82rem; font-weight: 700; color: #333; }
.notif-item-tag {
  font-size: .6rem;
  font-weight: 700;
  color: #c62828;
  background: #ffe3e3;
  border-radius: 6px;
  padding: 1px 5px;
  margin-left: 4px;
}
.notif-item-detalle { font-size: .74rem; color: #666; line-height: 1.35; }
/* Colores por tipo — N.P. morado, N.V. rojo, N.R. verde */
.notif-item.notif-np { border-left-color: #6a1b9a; }
.notif-item.notif-np .notif-item-icon { background: #f3e5f5; color: #6a1b9a; }
.notif-item.notif-np .notif-item-tag { color: #6a1b9a; background: #f3e5f5; }
.notif-item.notif-nv { border-left-color: #e53935; }
.notif-item.notif-nv .notif-item-icon { background: #ffebee; color: #e53935; }
.notif-item.notif-nv .notif-item-tag { color: #c62828; background: #ffe3e3; }
.notif-item.notif-nr { border-left-color: #43a047; }
.notif-item.notif-nr .notif-item-icon { background: #e8f5e9; color: #2e7d32; }
.notif-item.notif-nr .notif-item-tag { color: #2e7d32; background: #e8f5e9; }
.notif-item.notif-nt { border-left-color: #f57c00; }
.notif-item.notif-nt .notif-item-icon { background: #fff3e0; color: #e65100; }
.notif-item.notif-nt .notif-item-tag { color: #e65100; background: #fff3e0; }
.notif-vacio {
  font-size: .82rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
}
.notif-vacio i { color: #2e7d32; font-size: 1.1rem; }
/* Agrupador por cliente (grid principal) */
.notif-cliente { margin-bottom: 14px; }
.notif-cliente-nombre {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 700;
  color: #1a73e8;
  margin: 0 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #eef;
}
.notif-cliente-count {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: #e53935;
  color: #fff;
  font-size: .72rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.notif-cliente .notif-item { margin-bottom: 6px; }
.notif-cliente-actual {
  font-size: .6rem;
  font-weight: 700;
  color: #1565c0;
  background: #e3f2fd;
  border-radius: 6px;
  padding: 1px 6px;
}

/* VISTAS DEL DETALLE (cambian con el menú lateral) */
.detalle-vista { display: none; }
.detalle-vista.active { display: block; }

@media (max-width: 600px) {
  .app-layout { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,.2);
  }
  .sidebar-brand {
    border-bottom: none;
    margin-bottom: 0;
    padding: 0 10px 0 4px;
    font-size: 1.05rem;
  }
  .sidebar-brand span { display: none; }
  .sidebar-menu { flex-direction: row; flex: 1; padding: 0; gap: 4px; }
  .sidebar-item { padding: 8px 12px; justify-content: center; }
  .notif-panel {
    width: 100%;
    position: static;
    height: auto;
    max-height: none;
    border-left: none;
    border-top: 1px solid #e5e7eb;
    order: 3;
  }
}

/* TAB CONTENT */
.tab-content {
  display: none;
  padding: 24px;
  max-width: 800px;
  margin: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.tab-content.active { display: block; }

/* TOOLBAR */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.toolbar input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: .95rem;
  outline: none;
  transition: border-color .2s;
}
.toolbar input:focus { border-color: #1a73e8; }

/* BUTTONS */
.btn-primary {
  background: #1a73e8;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .95rem;
  transition: background .2s;
  white-space: nowrap;
}
.btn-primary:hover { background: #1558b0; }
.btn-evento { background: #039be5; }
.btn-evento:hover { background: #0277bd; }
.btn-add-mini {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #1a73e8;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: background .2s;
}
.btn-add-mini:hover { background: #1558b0; }
.btn-secondary {
  background: #e0e0e0;
  color: #333;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .95rem;
  transition: background .2s;
}
.btn-secondary:hover { background: #c8c8c8; }
.btn-danger {
  background: #e53935;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-size: .95rem;
  transition: background .2s;
}
.btn-danger:hover { background: #b71c1c; }

/* ICON BUTTONS */
.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 1.2rem;
  transition: background .2s, transform .15s;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn.edit { color: #1a73e8; }
.icon-btn.edit:hover { background: #e3f2fd; transform: scale(1.1); }
.icon-btn.delete { color: #e53935; }
.icon-btn.delete:hover { background: #ffebee; transform: scale(1.1); }
.icon-btn.ver { color: #546e7a; }
.icon-btn.ver:hover { background: #eceff1; transform: scale(1.1); }

/* TABLE */
.table-wrapper { overflow-x: auto; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.1); }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: .9rem;
}
thead tr { background: #1a73e8; color: #fff; }
th { padding: 12px 14px; text-align: left; font-weight: 600; white-space: nowrap; }
td { padding: 11px 14px; border-bottom: 1px solid #f0f0f0; vertical-align: middle; max-width: 0; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #f5f9ff; }
.actions-cell { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
th:last-child, td:last-child { text-align: right; white-space: nowrap; padding-right: 16px; }
.th-acciones { text-align: right; padding-right: 16px; }
.col-truncar { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 120px; }
/* Nombres y apellidos: se muestran completos, sin recortar */
.col-nombre { white-space: nowrap; max-width: none; }
.col-correo { max-width: 130px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty-msg { text-align: center; color: #999; padding: 32px; background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.1); }

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  animation: slideIn .2s ease;
}
.modal-sm { max-width: 400px; }
@keyframes slideIn {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}
.modal h2 { margin-bottom: 20px; font-size: 1.2rem; color: #1a73e8; }
.modal p  { margin-bottom: 20px; color: #555; }

/* FORM */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: .85rem; font-weight: 600; color: #555; }
.form-group input, .form-group select {
  padding: 9px 12px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
  width: 100%;
}
.form-group input:focus, .form-group select:focus { border-color: #1a73e8; }

/* DROPZONE */
.file-group { grid-column: span 1; }
.dropzone {
  border: 2px dashed #1a73e8;
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  background: #f5f9ff;
  transition: background .2s;
  height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  position: relative;
}
.dropzone:hover { background: #e3f2fd; }
.dropzone span { font-size: .82rem; color: #888; }
/* La caja mantiene su tamaño fijo; la imagen ocupa todo el ancho, centrada y recortada en alto */
.preview-img { display: none; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 100%; height: auto; border-radius: 6px; }
/* Variante: la imagen se muestra completa dentro de la caja (firma y huella) */
.preview-img.preview-contain { width: auto; height: auto; max-width: 100%; max-height: 100%; }
/* Botón para eliminar la foto cargada (esquina superior derecha de la caja) */
.btn-eliminar-foto {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 3;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(229, 57, 53, .92);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.btn-eliminar-foto:hover { background: #c62828; }

/* MODAL ACTIONS */
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* RESPONSIVE */
@media (max-width: 600px) {
  .navbar-inner { padding: 0 16px; }
  .brand { font-size: 1rem; }
  .tab { padding: 8px 12px; font-size: .85rem; }

  .tab-content { padding: 12px; }

  .toolbar { gap: 8px; }
  .toolbar input { min-width: 0; font-size: .9rem; }
  .btn-primary { padding: 10px 14px; font-size: .9rem; }

  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal {
    border-radius: 16px 16px 0 0;
    max-height: 92vh;
    padding: 20px 16px;
    width: 100%;
  }
  .modal-sm {
    border-radius: 16px 16px 0 0;
    max-width: 100%;
  }

  .form-grid { grid-template-columns: 1fr; gap: 10px; }
  .form-group input, .form-group select { font-size: .9rem; }

  .modal-actions { justify-content: stretch; }
  .modal-actions button { flex: 1; }

  .table-wrapper { border-radius: 0; box-shadow: none; }
}

/* CARDS MÓVIL - CLIENTES */
.cards-list {
  display: none;
  flex-direction: column;
  gap: 10px;
}
.cliente-card {
  background: #fff;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
  gap: 8px;
  overflow: hidden;
}
.card-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.card-nombre {
  font-size: .95rem;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}
.card-detalle {
  font-size: .8rem;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.card-detalle i { font-size: 1rem; color: #1a73e8; flex-shrink: 0; }
.card-actions { display: flex; flex-direction: column; gap: 6px; align-items: center; }

/* DROPZONE BUTTONS */
.dropzone-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; position: relative; z-index: 2; }
.btn-dropzone {
  background: #fff;
  border: 1px solid #1a73e8;
  color: #1a73e8;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .82rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background .2s;
}
.btn-dropzone:hover { background: #e3f2fd; }
.btn-dropzone i { font-size: 1rem; }

/* MODAL DETALLE CLIENTE */
.modal-detalle { max-width: 600px; }
.detalle-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.detalle-header h2 { color: #1a73e8; font-size: 1.2rem; }
.detalle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}
@media (max-width: 600px) {
  .detalle-grid { grid-template-columns: 1fr; }
}
.detalle-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: #f5f9ff;
  border-radius: 8px;
  padding: 10px 34px 10px 12px;
  position: relative;
}
.btn-editar-campo {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: #1a73e8;
  cursor: pointer;
  padding: 4px 5px;
  border-radius: 6px;
  font-size: .95rem;
  line-height: 1;
  transition: background .2s, transform .2s;
}
.btn-editar-campo:hover { background: #e3f2fd; transform: scale(1.1); }
.detalle-label {
  font-size: .78rem;
  font-weight: 600;
  color: #1a73e8;
  display: flex;
  align-items: center;
  gap: 5px;
}
.detalle-label i { font-size: 1rem; }
.detalle-valor { font-size: .9rem; color: #333; }
.detalle-dni-imgs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.detalle-img-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.detalle-img {
  width: 100%;
  height: 160px;
  border-radius: 8px;
  object-fit: contain;
  border: 1px solid #e0e0e0;
}
.detalle-sin-img {
  font-size: .82rem;
  color: #aaa;
  text-align: center;
  padding: 20px;
  border: 1px dashed #ccc;
  border-radius: 8px;
}
tbody tr { cursor: pointer; }

/* SECCIÓN TARJETAS EN DETALLE CLIENTE */
.detalle-tarjetas { margin-top: 20px; }
.detalle-section-title {
  font-size: 1rem;
  color: #1a73e8;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.detalle-sin-tarjetas { font-size: .85rem; color: #aaa; margin-top: 16px; }

/* ACORDEÓN */
.acordeon { border: 1px solid #e0e0e0; border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.acordeon-header {
  width: 100%;
  background: #f5f9ff;
  border: none;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 600;
  color: #1a73e8;
  transition: background .2s;
}
.acordeon-header:hover { background: #e3f2fd; }
.acordeon-header span { display: flex; align-items: center; gap: 6px; }
.acordeon-icon { transition: transform .25s; font-size: 1rem; }
.acordeon-body { display: none; padding: 0 14px; background: #fff; }
.acordeon-body.open { display: block; padding: 12px 14px; }

/* TARJETA DENTRO DEL ACORDEÓN */
.tarjeta-detalle {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid #1a73e8;
}
.tarjeta-fila {
  display: flex;
  justify-content: space-between;
  font-size: .88rem;
  padding: 3px 0;
  color: #444;
}
.tarjeta-fila .detalle-label {
  font-size: .78rem;
  color: #1a73e8;
  font-weight: 600;
}

/* HEADER SECCIÓN TARJETAS EN DETALLE */
.detalle-tarjetas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.detalle-tarjetas-header .seccion-titulo { margin: 0; border: none; }
.detalle-tarjetas-header .btn-primary { padding: 8px 14px; font-size: .85rem; display: flex; align-items: center; gap: 6px; }

/* FIRMA CANVAS */
.firma-wrapper {
  border: 2px dashed #1a73e8;
  border-radius: 8px;
  background: #f5f9ff;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 120px;
}
#firmaCanvas {
  width: 100%;
  flex: 1;
  cursor: crosshair;
  display: block;
  touch-action: none;
}
.firma-btns {
  display: flex;
  justify-content: flex-end;
  padding: 4px 8px;
  border-top: 1px solid #e0e0e0;
  background: #fff;
  flex-shrink: 0;
}

/* VENCIMIENTO + CVV en mismo espacio */
.venc-cvv-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.venc-cvv-group .form-group { margin: 0; }
.cvv-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cvv-dinamico {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .72rem;
  font-weight: 600;
  color: #1a73e8;
  cursor: pointer;
}
.cvv-dinamico input { cursor: pointer; }

/* SUBGRUPOS DE VUELTA dentro de "Mis Vueltas" */
.vuelta-grupo { margin-bottom: 16px; }
.vuelta-grupo:last-child { margin-bottom: 0; }
.vuelta-grupo-titulo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9rem;
  font-weight: 700;
  color: #1a73e8;
  margin: 4px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e3f2fd;
}
.vuelta-grupo-titulo > span { display: flex; align-items: center; gap: 6px; }
.vuelta-acciones { display: flex; align-items: center; gap: 4px; }

/* BLOQUEO: acciones dentro de las cards del modal */
.tarjeta-mini.tarjeta-bloqueada {
  border: 1px solid #f3c1c1;
  background: #fdf0f0;
}
/* Tono por banco (tarjetas activas) */
.tarjeta-mini.banco-interbank {
  border: 1px solid #cde9cf;
  background: #f2faf3;
}
.tarjeta-mini.banco-bcp {
  border: 1px solid #c8e6f8;
  background: #f0f9ff;
}
.tarjeta-estado {
  font-size: .64rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  width: fit-content;
}
.tarjeta-estado.activo { color: #2e7d32; background: #e8f5e9; }
.tarjeta-estado.bloqueado { color: #c62828; background: #ffe3e3; }
.tarjeta-estados { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tarjeta-estados .tarjeta-estado { margin-top: 4px; }
.tarjeta-estado.badge-cod { color: #283593; background: #e8eaf6; }
.tarjeta-estado.badge-fecha { color: #546e7a; background: #eceff1; }
.bloq-btn {
  margin-top: 6px;
  width: 100%;
  background: #c62828;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.bloq-btn:hover { background: #a91f1f; }
.bloq-modal-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 600;
  color: #555;
  margin: -4px 0 12px;
}
.bloq-card-form { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.bloq-card-form input {
  width: 100%;
  padding: 5px 7px;
  font-size: .78rem;
  border: 1px solid #ddd;
  border-radius: 6px;
}
.bloq-form-btns { display: flex; gap: 6px; }
.bloq-card-form .btn-primary,
.bloq-card-form .btn-secondary { padding: 5px 10px; font-size: .75rem; flex: 1; }
.bloq-card-estado { margin-top: 6px; display: flex; flex-direction: column; gap: 3px; align-items: flex-start; }
.bloq-badge {
  font-size: .68rem;
  font-weight: 700;
  color: #c62828;
  background: #ffe3e3;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.bloq-cod { font-size: .72rem; color: #555; }
.bloq-btn-mini {
  background: #eee;
  border: none;
  border-radius: 5px;
  padding: 3px 7px;
  cursor: pointer;
  color: #555;
  font-size: .8rem;
}
.bloq-btn-mini:hover { background: #e0e0e0; }
.bloq-btn-mini.delete { color: #c62828; }

/* BLOQUEO DE TARJETAS dentro de una vuelta */
.vuelta-bloqueo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 6px;
}
.vuelta-bloqueo-titulo {
  font-size: .85rem;
  font-weight: 600;
  color: #c62828;
  display: flex;
  align-items: center;
  gap: 5px;
}
.btn-toggle-bloqueo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #fff5f5;
  border: 1px solid #ffd6d6;
  color: #c62828;
  font-size: .76rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}
.btn-toggle-bloqueo:hover { background: #ffe3e3; }
.bloqueo-toggle-icon { transition: transform .2s; }
.bloqueo-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  background: #fff5f5;
  border: 1px solid #ffd6d6;
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
}
.bloqueo-info { display: flex; flex-direction: column; gap: 2px; }
.bloqueo-tarjeta {
  font-size: .82rem;
  font-weight: 600;
  color: #444;
  display: flex;
  align-items: center;
  gap: 5px;
}
.bloqueo-codigo {
  font-size: .78rem;
  color: #c62828;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}
.bloqueo-fecha {
  font-size: .74rem;
  color: #777;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* CONSTANCIA DE BLOQUEO (imágenes por vuelta) */
.const-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}
.const-thumb { position: relative; }
.const-thumb img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  display: block;
  transition: opacity .2s;
}
.const-thumb img:hover { opacity: .85; }
.const-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e53935;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
}

/* EVIDENCIAS (imágenes/PDF) en el modal de evento */
.eb-evidencias-lista { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.eb-ev-item {
  position: relative;
  width: 76px;
  height: 76px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #fafafa;
}
.eb-ev-item img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 8px; }
.eb-ev-pdf {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px;
  color: #c62828;
  text-align: center;
}
.eb-ev-pdf i { font-size: 1.7rem; }
.eb-ev-doc { color: #546e7a; }
.eb-ev-pdf span {
  font-size: .6rem;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.eb-ev-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e53935;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  z-index: 2;
}

/* PENDIENTE / RESPONDIDO (solicitud de historial clínico) */
.evt-pendiente {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  background: #ffebee;
  border: 1px solid #ef9a9a;
  border-radius: 8px;
}
.evt-pendiente-txt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 700;
  color: #d32f2f;
}
.btn-responder {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: none;
  border-radius: 8px;
  background: #f4433f;
  color: #fff;
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-responder:hover { background: #d32f2f; }
.evt-respondido {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 5px 10px;
  background: #e8f5e9;
  border: 1px solid #c3e6cb;
  border-radius: 8px;
  font-size: .76rem;
  font-weight: 700;
  color: #2e7d32;
}

/* EVIDENCIAS en la tarjeta del evento */
.evento-evidencias { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.evento-doc {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  width: 64px;
  height: 74px;
  padding: 6px 4px;
  background: #e8f0fe;
  border: 1px solid #c9ddfb;
  border-radius: 8px;
  color: #1565c0;
  font-size: .66rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.evento-doc i { font-size: 1.9rem; }
.evento-doc:hover { background: #d6e4fb; }
.evento-doc { text-decoration: none; }
.evento-doc-pdf {
  background: #fdecea;
  border-color: #f5c6c0;
  color: #c62828;
}
.evento-doc-pdf:hover { background: #fbddd8; }
.evento-doc-word {
  background: #eceff1;
  border-color: #cfd8dc;
  color: #546e7a;
}
.evento-doc-word:hover { background: #dfe4e7; }
.evento-pdf {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #fdecea;
  border: 1px solid #f5c6c0;
  border-radius: 8px;
  color: #c62828;
  font-size: .76rem;
  font-weight: 600;
  text-decoration: none;
  max-width: 140px;
}
.evento-pdf i { font-size: 1.1rem; flex-shrink: 0; }
.evento-pdf span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evento-pdf:hover { background: #fbddd8; }

/* TRATAMIENTOS (sin acordeón) */
.tratamiento-panel {
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: #fff;
}
.tratamiento-titulo {
  font-size: .9rem;
  font-weight: 700;
  color: #333;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid #eee;
  padding-bottom: 6px;
  margin: 0 0 6px;
}

/* CÓDIGOS DE BLOQUEO dentro de una vuelta */
.vuelta-bloqueos { margin-top: 14px; }
.vuelta-bloqueos-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}
.vuelta-bloqueos-titulo {
  font-size: .85rem;
  font-weight: 700;
  color: #e53935;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bloq-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1px solid #e53935;
  border-radius: 50%;
  background: none;
  color: #e53935;
  cursor: pointer;
  font-size: .9rem;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.bloq-add-btn:hover { background: #e53935; color: #fff; }
.bloq-cod-lista { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.bloq-cod-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fafafa;
}
.bloq-cod-banco {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .8rem;
  font-weight: 600;
  color: #3949ab;
}
.bloq-cod-codigo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .82rem;
  font-weight: 700;
  color: #333;
  flex: 1;
}
.bloq-cod-item .icon-btn { flex-shrink: 0; padding: 4px 6px; font-size: 1rem; }
.btn-mini-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: #1a73e8;
  color: #fff;
  cursor: pointer;
  font-size: 1.05rem;
  flex-shrink: 0;
  transition: background .15s;
}
.btn-mini-add:hover { background: #1558b0; }

/* RECLAMOS dentro de una vuelta */
.vuelta-add-btns { display: flex; gap: 8px; }
.recl-grupo { margin-top: 8px; }
.recl-grupo-titulo {
  font-size: .8rem;
  font-weight: 600;
  color: #555;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 8px 0 4px;
}
.recl-vacio { font-size: .78rem; color: #aaa; margin: 2px 0 4px; }
.recl-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 4px;
}
.recl-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
}
.recl-card-info {
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  text-align: center;
}
.recl-thumb { position: relative; width: 100%; }
.recl-thumb img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px 10px 0 0;
  border: none;
  cursor: pointer;
  display: block;
  transition: opacity .2s;
}
.recl-thumb img:hover { opacity: .85; }
.recl-banco-grupo { margin-bottom: 10px; }
.recl-banco-subtitulo {
  font-size: .74rem;
  font-weight: 600;
  color: #1565c0;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 6px 0 4px;
}
.recl-tipo {
  font-size: .68rem;
  font-weight: 600;
  color: #6a1b9a;
  background: #f3e5f5;
  padding: 1px 6px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.recl-tipo-sin { color: #999; background: #f0f0f0; }
.recl-monto {
  font-size: .74rem;
  font-weight: 700;
  color: #0288d1;
}
.recl-evid {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid #cfd8dc;
  background: #f5f7f9;
  color: #37474f;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  cursor: pointer;
}
.recl-evid:hover { background: #eceff1; }
/* Chip PDF en el modal de vincular reclamo */
.eb-evid-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #ef9a9a;
  background: #ffebee;
  color: #c62828;
  font-size: .8rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.eb-evid-chip:hover { background: #ffcdd2; }
/* APARTADO RECLAMOS (reporte por vuelta / banco, sin imagen) */
.recl-ap-vuelta-grupo { margin-bottom: 14px; }
.recl-ap-titulo-primario {
  font-size: .85rem;
  font-weight: 700;
  color: #1565c0;
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid #e3f2fd;
  padding-bottom: 4px;
  margin: 8px 0 6px;
}
.recl-ap-banco-sub { margin: 0 0 8px 6px; }
.recl-ap-titulo-sec {
  font-size: .78rem;
  font-weight: 600;
  color: #555;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 6px 0 4px;
}
.btn-registrar-evento {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px dashed #1565c0;
  border-radius: 10px;
  background: #f5faff;
  color: #1565c0;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.btn-registrar-evento:hover { background: #1565c0; color: #fff; }
.evt-chat { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
.evt-chat-burbuja {
  position: relative;
  align-self: flex-start;
  max-width: 85%;
  padding: 8px 12px;
  background: #eef7ff;
  border: 1px solid #d6e8fb;
  border-radius: 12px 12px 12px 3px;
}
.evt-chat-fecha {
  font-size: .72rem;
  font-weight: 700;
  color: #1565c0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.evt-chat-tipo {
  font-size: .82rem;
  font-weight: 700;
  color: #6a1b9a;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 2px;
}
.evt-chat-desc { font-size: .82rem; color: #333; margin-top: 3px; }
.evt-chat-img {
  display: block;
  margin-top: 6px;
  max-width: 160px;
  max-height: 160px;
  border-radius: 8px;
  border: 1px solid #d6e8fb;
  cursor: pointer;
}
.evt-chat-del {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e53935;
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
}
.recl-fila {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: #f9f9f9;
  border-radius: 6px;
  margin-bottom: 4px;
}
.recl-fila-tipo {
  font-size: .78rem;
  font-weight: 600;
  color: #6a1b9a;
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.recl-fila-monto { font-size: .8rem; font-weight: 700; color: #0288d1; }
.recl-fila-clic { cursor: pointer; transition: background .15s; }
.recl-fila-clic:hover { background: #eef2f7; }
.recl-fila-img-icon { color: #1565c0; font-size: 1rem; flex-shrink: 0; }
.recl-fila-acciones { display: flex; gap: 2px; flex-shrink: 0; }
.recl-fila-acciones .icon-btn { padding: 4px 6px; font-size: 1rem; color: #555; }
.recl-fila-acciones .icon-btn:hover { background: #eef2ff; }
.recl-fila-acciones .icon-btn.delete { color: #e53935; }
.recl-fila-acciones .icon-btn.delete:hover { background: #ffebee; }
.recl-detalle-acordeon { margin-bottom: 6px; }
.recl-detalle-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid #e3e8ee;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: .76rem;
  font-weight: 600;
  color: #444;
  cursor: pointer;
}
.recl-detalle-header > span { display: flex; align-items: center; gap: 5px; }
.recl-detalle-titulo { flex: 1; min-width: 0; }
.recl-detalle-total { color: #0288d1; font-weight: 700; margin-right: 8px; white-space: nowrap; }
.recl-detalle-header:hover { background: #e9eef4; }
.recl-detalle-icon { transition: transform .2s; }
.recl-detalle-body { display: none; padding: 8px 2px 0; }
.recl-detalle-body.open { display: block; }
.recl-detalle-plano { padding: 2px 2px 0; }
.recl-ap-encabezado {
  font-size: .95rem;
  font-weight: 700;
  color: #1565c0;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

/* MENSAJE DE CHAT DEL SISTEMA (por banco) */
.chat-sistema { display: flex; margin: 8px 0 4px; }
.chat-burbuja {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #eef6ff;
  border: 1px solid #d6e8fb;
  border-radius: 12px 12px 12px 4px;
  padding: 8px 12px;
  font-size: .8rem;
  line-height: 1.35;
  color: #1a3b5d;
  max-width: 92%;
}
.chat-burbuja i {
  color: #1a73e8;
  font-size: 1.15rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.recl-menu { position: absolute; top: 4px; right: 4px; }
.recl-menu-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .55);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: .8rem;
}
.recl-menu-btn:hover { background: rgba(0, 0, 0, .75); }

/* COLUMNA P.S. (pago de seguro pendiente) */
.col-ps { text-align: right; width: 1%; white-space: nowrap; }
/* P.S. y R.S.E.: encabezados alineados a la derecha (últimas 2 columnas) */
#tablaClientes th:nth-child(n+4):not(:last-child) { text-align: right; }
.nr-link { cursor: pointer; }
.nr-link:hover { filter: brightness(.9); }
.ps-pendiente {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #fdecea;
  color: #c62828;
  font-weight: 700;
  font-size: .8rem;
  border-radius: 11px;
}
.ps-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  background: #e8f0fe;
  color: #1a73e8;
  font-weight: 700;
  font-size: .8rem;
  border-radius: 11px;
}
/* Indicadores con pendientes por tipo — N.P. morado, N.V. rojo, N.R. verde */
.ps-pendiente.badge-np { background: #f3e5f5; color: #6a1b9a; }
.ps-pendiente.badge-nv { background: #ffe3e3; color: #c62828; }
.ps-pendiente.badge-nr { background: #e8f5e9; color: #2e7d32; }

/* SECCIONES ACTIVAS / BLOQUEADAS en la pestaña Tarjetas */
.tarjetas-seccion-titulo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  font-weight: 700;
  margin: 14px 0 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid #eee;
}
.tarjetas-seccion-titulo:first-child { margin-top: 0; }
.tarjetas-seccion-titulo.activas { color: #2e7d32; }
.tarjetas-seccion-titulo.bloqueadas { color: #c62828; }

/* SUBGRUPOS POR BANCO dentro de "Mis Tarjetas" */
.tarjeta-banco-grupo { margin-bottom: 14px; }
.tarjeta-banco-grupo:last-child { margin-bottom: 0; }
.tarjeta-banco-titulo {
  font-size: .9rem;
  font-weight: 700;
  color: #1a73e8;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 4px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #e3f2fd;
}

/* AVISO POR BANCO: tarjetas sin seguro */
.aviso-sin-seguro,
.aviso-con-seguro {
  font-size: .72rem;
  font-weight: 600;
  font-family: inherit;
  padding: 2px 8px;
  border: none;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  vertical-align: middle;
}
.tarjeta-banco-seguro { margin: 2px 0 10px; }
.tarjeta-banco-seguro .aviso-sin-seguro,
.tarjeta-banco-seguro .aviso-con-seguro { margin-left: 0; }
.aviso-sin-seguro { color: #b71c1c; background: #fdecea; cursor: pointer; }
.aviso-sin-seguro:hover { background: #f9d2cc; }
/* CTA de compra: se ofrece "Comprar seguro" cuando el cliente tiene cuentas y aún no hay pagos */
.aviso-comprar-seguro { color: #fff; background: #1a73e8; }
.aviso-comprar-seguro:hover { background: #1667d6; }
/* Seguro comprado pero con pagos pendientes (mes actual sin cubrir) */
.aviso-pagos-pendientes { color: #e65100; background: #fff3e0; }
.aviso-pagos-pendientes:hover { background: #ffe0b2; }
/* ── Pestaña "Mis Seguros" ─────────────────────────────────────────────── */
.seg-card {
  border: 1px solid #e3e7ee;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 14px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.seg-card:last-child { margin-bottom: 0; }
.seg-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.seg-estado {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
}
.seg-card-head-acciones {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.seg-badge-poliza {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .74rem;
  font-weight: 600;
  font-family: inherit;
  color: #1a73e8;
  background: #e8f0fe;
  border: 1px solid #d2e3fc;
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
}
.seg-badge-poliza:hover { background: #d2e3fc; }
.seg-estado-sin   { color: #5f6368; background: #eef1f5; }
.seg-estado-aldia { color: #2e7d32; background: #e8f5e9; }
.seg-estado-pend  { color: #e65100; background: #fff3e0; }
.seg-card-info {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0 4px;
  font-size: .82rem;
  color: #444;
}
.seg-card-info span { display: inline-flex; align-items: center; gap: 5px; }
.seg-card-vacio {
  margin: 10px 0 4px;
  font-size: .82rem;
  color: #999;
  font-style: italic;
}
/* Lista de pagos dentro de la tarjeta de Mis Seguros */
.seg-pagos {
  margin-top: 12px;
  border-top: 1px solid #eceff1;
  padding-top: 10px;
}
.seg-pagos-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.seg-pagos-titulo {
  font-size: .74rem;
  font-weight: 700;
  color: #5f6368;
  display: flex;
  align-items: center;
  gap: 5px;
}
.seg-pago-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: .8rem;
}
.seg-pago-item:nth-child(odd) { background: #fafbfc; }
.seg-pago-periodo {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  color: #1a73e8;
}
.seg-pago-reg { font-size: .72rem; color: #9aa0a6; }
.seg-pago-btns { margin-left: auto; display: flex; gap: 2px; flex-shrink: 0; }
.seg-card-acciones { margin-top: 12px; }
.seg-btn { display: inline-flex; align-items: center; gap: 6px; }
.seg-btn-comprar { background: #1a73e8; }
.seg-btn-comprar:hover { background: #1667d6; }
.seg-card.notif-resaltado { box-shadow: 0 0 0 3px rgba(26,115,232,.5); }
/* Resumen de la póliza adquirida dentro del modal de seguro */
.seguro-poliza-resumen {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #e8f5e9;
  border: 1px solid #c8e6c9;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.seguro-poliza-datos { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.seguro-poliza-titulo {
  font-size: .72rem;
  font-weight: 700;
  color: #2e7d32;
  display: flex;
  align-items: center;
  gap: 5px;
}
.seguro-poliza-linea { font-size: .85rem; color: #33691e; font-weight: 600; }
.seguro-poliza-btns { display: flex; gap: 4px; flex-shrink: 0; }
/* Parpadeo rojo intenso (3 veces) al llegar desde una notificación N.P. */
@keyframes seguroParpadeo {
  0%, 100% { background: #fdecea; color: #b71c1c; box-shadow: none; transform: scale(1); }
  50%      { background: #d50000; color: #fff;    box-shadow: 0 0 0 4px rgba(213,0,0,.35); transform: scale(1.05); }
}
.aviso-sin-seguro.seguro-parpadeo { animation: seguroParpadeo .45s ease-in-out 3; }
/* Parpadeo genérico (3 veces) para opciones N.V. / N.R. — solo halo, no cambia el fondo */
@keyframes notifResaltado {
  0%, 100% { box-shadow: 0 0 0 0 rgba(213,0,0,0); }
  50%      { box-shadow: 0 0 0 4px rgba(213,0,0,.55); }
}
.notif-resaltado {
  animation: notifResaltado .45s ease-in-out 3;
  border-radius: 8px;
  position: relative;
  z-index: 1;
}
.aviso-con-seguro { color: #2e7d32; background: #e8f5e9; cursor: pointer; }
.aviso-con-seguro:hover { background: #d4ecd6; }
.btn-pago-seguro {
  font-size: .75rem;
  font-weight: 600;
  color: #43a047;
  background: none;
  border: none;
  padding: 2px 0;
  margin: 2px 0 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-pago-seguro:hover { text-decoration: underline; }

/* HISTORIAL DE PAGOS DE SEGURO (en el modal) */
.seguro-sin-pagos {
  font-size: .85rem;
  color: #999;
  text-align: center;
  background: #f7f7f7;
  border-radius: 8px;
  padding: 10px;
  margin: 0 0 14px;
}
.seguro-pagos-lista {
  margin-bottom: 16px;
  border: 1px solid #eee;
  border-radius: 10px;
  padding: 6px 14px;
  background: #fafafa;
}
.seguro-pagos-titulo {
  font-size: .85rem;
  font-weight: 700;
  color: #1a73e8;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 4px;
}
.seguro-pago-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eee;
}
.seguro-pago-item:last-child { border-bottom: none; }
.seguro-pago-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.seguro-pago-periodo {
  font-size: .9rem;
  font-weight: 700;
  color: #1a73e8;
  display: flex;
  align-items: center;
  gap: 5px;
}
.seguro-pago-reg {
  font-size: .72rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 4px;
}
.seguro-pago-nombre {
  font-size: .78rem;
  color: #37474f;
  display: flex;
  align-items: center;
  gap: 4px;
}
.seguro-pago-precio {
  font-size: .78rem;
  font-weight: 700;
  color: #2e7d32;
  display: flex;
  align-items: center;
  gap: 4px;
}
.seguro-pago-noimg {
  font-size: .72rem;
  color: #bbb;
  font-style: italic;
  flex-shrink: 0;
}
.seguro-pago-btns { display: flex; gap: 6px; flex-shrink: 0; }
.seguro-pago-ver-btn, .seguro-pago-del-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  transition: background .15s;
}
.seguro-pago-ver-btn { background: #e8f0fe; color: #1a73e8; }
.seguro-pago-ver-btn:hover { background: #d2e3fc; }
.seguro-pago-del-btn { background: #fdecea; color: #c62828; }
.seguro-pago-del-btn:hover { background: #f9d2cc; }

/* CARDS COMPACTAS DE TARJETA (3 por fila) */
.tarjetas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tarjeta-mini {
  background: #f9f9f9;
  border: 1px solid #e6e6e6;
  border-radius: 10px;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tarjeta-mini-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tarjeta-mini-tipo {
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.tarjeta-mini-tipo.debito  { background: #e3f2fd; color: #1565c0; }
.tarjeta-mini-tipo.credito { background: #fce4ec; color: #c2185b; }
.tarjeta-mini-tipo.soles   { background: #e3f2fd; color: #1565c0; }
.tarjeta-mini-tipo.dolares { background: #e8f5e9; color: #2e7d32; }
.tarjeta-mini-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.tarjeta-mini-acciones { display: flex; gap: 6px; margin-top: 8px; min-height: 29px; }
.tarjeta-copy-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: .68rem;
  font-weight: 700;
  color: #1a73e8;
  background: #e8f0fe;
  border: none;
  border-radius: 6px;
  padding: 6px 6px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
/* Tarjeta sin cuentas: badge + botón "+" en la fila superior */
.tarjeta-mini-badges { display: flex; align-items: center; gap: 4px; }
.badge-sincuentas {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: .64rem;
  font-weight: 700;
  color: #e65100;
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 10px;
  padding: 2px 8px;
}
.icon-btn.add-cuenta { color: #f57c00; }
.icon-btn.add-cuenta:hover { background: #fff3e0; transform: scale(1.1); }
/* MODAL VINCULAR CUENTAS */
.vc-lista { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; max-height: 320px; overflow-y: auto; }
.vc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  background: #fafafa;
  transition: background .15s, border-color .15s;
}
.vc-item:hover { background: #f1f5f9; }
.vc-item-check { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; cursor: pointer; }
.vc-item input[type=checkbox] { width: 18px; height: 18px; flex-shrink: 0; cursor: pointer; accent-color: #1a73e8; }
.vc-item-rol.vc-rol-clic { cursor: pointer; }
.vc-item-rol.vc-rol-clic:hover { background: #dbe4ea; }
.vc-item-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.vc-item-cuenta { font-size: .85rem; font-weight: 700; color: #333; display: inline-flex; align-items: center; gap: 5px; }
.vc-item-otra { font-size: .72rem; color: #b26a00; display: inline-flex; align-items: center; gap: 4px; }
.vc-item-rol {
  flex-shrink: 0;
  font-size: .66rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 9px;
}
.vc-item-rol.rol-principal { color: #1565c0; background: #e3f2fd; }
.vc-item-rol.rol-secundaria { color: #546e7a; background: #eceff1; }
.vc-vacio { font-size: .85rem; color: #888; margin: 6px 0 10px; }
.cuenta-tarjeta { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: #1565c0; }
.tarjeta-copy-btn:hover { background: #d2e3fc; }
.tarjeta-copy-btn.copiado { background: #e8f5e9; color: #2e7d32; }
.tarjeta-copy-btn:disabled {
  background: #f0f0f0;
  color: #bbb;
  cursor: not-allowed;
  border-color: #e0e0e0;
  opacity: .7;
}
.tarjeta-copy-btn:disabled:hover { background: #f0f0f0; }
/* TABLA DE CUENTAS */
.cuenta-banco-grupo { margin-bottom: 18px; }
.cuenta-banco-header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.cuenta-banco-header .tarjeta-banco-titulo { margin: 0; }
.cuenta-banco-grupo:last-child { margin-bottom: 0; }
.cuentas-tabla { width: 100%; border-collapse: collapse; font-size: .85rem; }
/* Anula el estilo global (encabezado azul y td max-width:0) que descuadra las celdas */
.cuentas-tabla thead tr { background: transparent; color: inherit; }
.cuentas-tabla tbody tr { cursor: default; }
.cuentas-tabla tbody tr:hover { background: #f9fbff; }
.cuentas-tabla th {
  text-align: left;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: #888;
  font-weight: 700;
  padding: 8px 10px;
  border-bottom: 2px solid #eee;
  white-space: nowrap;
}
.cuentas-tabla td {
  padding: 9px 10px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
  max-width: none;
  white-space: nowrap;
}
.cuentas-tabla th:last-child, .cuentas-tabla td:last-child { padding-right: 10px; }
.cuentas-tabla tr:last-child td { border-bottom: none; }
.cuenta-dato { font-weight: 600; color: #333; }
.cuenta-vacio { color: #bbb; }
.cuenta-copy {
  margin-left: 6px;
  border: none;
  background: #e8f0fe;
  color: #1a73e8;
  border-radius: 5px;
  padding: 3px 6px;
  cursor: pointer;
  font-size: .85rem;
  vertical-align: middle;
}
.cuenta-copy:hover { background: #d2e3fc; }
.cuenta-copy.copiado { background: #e8f5e9; color: #2e7d32; }
.cuenta-acciones { white-space: nowrap; text-align: right; }
.tarjeta-mini-num {
  font-size: .82rem;
  font-weight: 600;
  color: #333;
  letter-spacing: .5px;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tarjeta-mini-venc {
  font-size: .74rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 5px;
}
.tarjeta-acciones { display: flex; gap: 2px; flex-shrink: 0; }
.tarjeta-mini .icon-btn { padding: 2px; font-size: 1rem; }
@media (max-width: 600px) {
  .tarjetas-grid { grid-template-columns: 1fr; }
}

/* IMÁGENES DE TARJETA en el detalle */
.tarjeta-imgs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 4px;
}
.tarjeta-img-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tarjeta-img {
  width: 140px;
  height: 90px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  transition: opacity .2s;
}
.tarjeta-img:hover { opacity: .85; }

/* BADGES ESTADO TRATAMIENTO */
.badge-estado {
  padding: 2px 10px;
  border-radius: 12px;
  font-size: .78rem;
  font-weight: 600;
}
.badge-pendiente   { background: #fff3cd; color: #856404; }
.badge-en-proceso  { background: #cfe2ff; color: #084298; }
.badge-completado  { background: #d1e7dd; color: #0a3622; }

/* EVENTOS DE TRATAMIENTO */
.evento-item {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-left: 3px solid #0288d1;
}
.evento-registro {
  font-size: .72rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}
.evento-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 4px; }
.evento-derecha { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.evento-derecha-top { display: flex; align-items: center; gap: 8px; }
.evento-menu { position: relative; }
.evento-menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 1rem;
  padding: 2px 5px;
  border-radius: 5px;
  display: flex;
  align-items: center;
}
.evento-menu-btn:hover { background: #ececec; color: #444; }
.evento-menu-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #e3e3e3;
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
  z-index: 50;
  min-width: 140px;
  overflow: hidden;
}
.evento-menu-dropdown.open { display: block; }
.evento-menu-dropdown button {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 14px;
  font-size: .85rem;
  color: #444;
  cursor: pointer;
  text-align: left;
}
.evento-menu-dropdown button:hover { background: #f3f4f6; }
.evento-menu-dropdown button.delete { color: #e53935; }
.evento-menu-dropdown button.delete:hover { background: #fdecea; }
.evento-tipo { font-size: .85rem; font-weight: 600; color: #0288d1; display: flex; align-items: center; gap: 5px; min-width: 0; }
.evento-fecha { font-size: .78rem; color: #888; white-space: nowrap; }
.evento-desc { font-size: .85rem; color: #555; margin: 4px 0; }
.evento-monto { font-size: .85rem; font-weight: 600; color: #1a73e8; margin: 2px 0; }
.evento-img {
  display: block;
  width: 120px;
  height: 90px;
  object-fit: cover;
  border-radius: 10px;
  margin-top: 2px;
  cursor: pointer;
  border: 1px solid #e0e0e0;
  transition: opacity .2s;
}
.evento-img:hover { opacity: .85; }

/* INPUT DESHABILITADO */
.form-group input:disabled,
.form-group select:disabled,
.form-group textarea:disabled {
  background: #f0f0f0;
  color: #aaa;
  cursor: not-allowed;
  border-color: #e0e0e0;
}

/* GRID DE DOCUMENTOS */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 4px 0 8px;
}
@media (max-width: 600px) {
  .docs-grid { grid-template-columns: 1fr; }
}
.doc-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.btn-descargar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #1a73e8;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .8rem;
  transition: background .2s;
}
.btn-descargar:hover { background: #1558b0; }

/* BOTÓN DESCARGA OVERLAY SOBRE IMAGEN */
.doc-img-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}
.doc-img-wrapper .detalle-img { width: 100%; display: block; }
.btn-descargar-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid rgba(255,255,255,0.8);
  color: #fff;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 1.3rem;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
  backdrop-filter: blur(2px);
}
.doc-img-wrapper:hover .btn-descargar-overlay { background: rgba(0,0,0,.55); transform: translate(-50%, -50%) scale(1.1); }
/* Botón para eliminar la imagen del documento (esquina superior derecha) */
.btn-eliminar-doc {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 32px;
  height: 32px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(229, 57, 53, .92);
  color: #fff;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,.35);
  transition: background .2s, transform .2s;
}
.btn-eliminar-doc:hover { background: #c62828; transform: scale(1.1); }

/* HEADER TRATAMIENTO */
.tratamiento-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}
.tratamiento-titulo {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin: 0;
}
.tratamiento-acciones {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

/* DROPDOWN DE CUENTAS EN CARD DE TARJETA */
/* DROPDOWN DE CUENTAS EN LA CARD (moneda izquierda, ···dígitos derecha) */
.cta-drop { position: relative; }
.cta-drop-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 150px;
  box-sizing: border-box;
  background: #e8f0fe;
  border: 1px solid #c9ddfb;
  color: #1565c0;
  border-radius: 6px;
  padding: 3px 8px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
}
.cta-drop.disabled .cta-drop-toggle { background: #f0f0f0; border-color: #e0e0e0; color: #777; cursor: default; }
.cta-drop-moneda { white-space: nowrap; }
.cta-drop-num { margin-left: auto; white-space: nowrap; }
.cta-drop-caret { flex-shrink: 0; font-size: .8rem; }
.cta-drop-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 20;
  min-width: 150px;
  background: #fff;
  border: 1px solid #d5d9e0;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  margin-top: 3px;
  overflow: hidden;
}
.cta-drop-menu.open { display: block; }
.cta-drop-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  padding: 7px 10px;
  font-size: .72rem;
  font-weight: 400;
  color: #333;
  cursor: pointer;
}
.cta-drop-opt.principal { font-weight: 700; }
.cta-drop-opt:hover { background: #f1f5f9; }

/* Grid de clientes: columnas ajustadas al ancho disponible, sin barra horizontal */
#tablaClientes th, #tablaClientes td { padding: 10px 8px; }
#tablaClientes .col-nombre {
  white-space: normal;          /* el nombre largo baja de línea en vez de ensanchar la tabla */
  overflow-wrap: anywhere;
  max-width: none;
  min-width: 70px;
}
#tablaClientes td:nth-child(3) { white-space: nowrap; max-width: none; } /* DNI */
#tablaClientes .col-ps { padding-left: 6px; padding-right: 6px; max-width: none; }
#tablaClientes th.col-acciones, #tablaClientes td.col-acciones {
  text-align: center; width: 1%; white-space: nowrap; padding: 6px 8px; max-width: none;
}
#tablaClientes td.col-acciones .icon-btn { padding: 4px 6px; }

/* Cards de clientes: todo en una sola línea para que todas midan lo mismo */
#cardsClientes .card-nombre { max-width: 100%; }
#cardsClientes .card-detalle { max-width: 100%; gap: 6px; justify-content: space-between; }
#cardsClientes .card-dni { flex-shrink: 0; } /* el DNI se muestra siempre completo */
#cardsClientes .card-badges { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }
#cardsClientes .card-badge-lbl { font-size: .65rem; color: #888; margin-left: 3px; }
#cardsClientes .card-badges .ps-ok, #cardsClientes .card-badges .ps-pendiente { min-width: 20px; height: 20px; font-size: .75rem; }
#cardsClientes .cliente-card > .icon-btn { flex-shrink: 0; }

/* Botón / estado de seguro junto a las cuentas de cada banco */
.cuenta-seg-texto { display: inline-flex; align-items: center; gap: 5px; font-size: .82rem; font-weight: 600; }
.cuenta-seg-sin { color: #c62828; }
.cuenta-seg-con { color: #2e7d32; }
.cuenta-seg-acciones { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; } /* alineado a la derecha */

/* Cards muy angostas: se ocultan las etiquetas N.P./N.V./N.R. para que los contadores quepan en una línea */
#cardsClientes .card-info { container-type: inline-size; }
@container (max-width: 190px) {
  #cardsClientes .card-badge-lbl { display: none; }
}

/* Cuadro de la póliza resaltado cuando se llega desde la notificación "Seguro sin póliza" */
.dropzone.dropzone-pendiente {
  border: 2px dashed #e53935 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, .18);
}

/* Cuentas: en espacios angostos la tabla se muestra como cards (una card por cuenta) */
.cuenta-banco-grupo { container-type: inline-size; }
@container (max-width: 640px) {
  .cuentas-tabla thead { display: none; }
  .cuentas-tabla, .cuentas-tabla tbody { display: block; width: 100%; }
  .cuenta-banco-grupo .table-wrapper { overflow: visible; box-shadow: none; }
  .cuentas-tabla tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 10px;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff;
    border: 1px solid #e8eaed;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
  }
  .cuentas-tabla tbody tr:hover { background: #fff; }
  .cuentas-tabla td {
    display: block;
    padding: 0; border: none; min-width: 0; max-width: none;
    white-space: normal; overflow-wrap: anywhere;   /* números largos (CCI) bajan de línea en vez de salirse */
    grid-column: 1 / -1;
  }
  .cuentas-tabla td[data-label]::before {
    content: attr(data-label);
    display: block;
    font-size: .7rem; color: #888; font-weight: 600; margin-bottom: 1px;
  }
  .cuentas-tabla td[data-label="Moneda"] { grid-column: 1; grid-row: 1; }
  /* Botones editar/eliminar arriba a la derecha de la card */
  .cuentas-tabla td.cuenta-acciones { grid-column: 2; grid-row: 1; justify-content: flex-end; padding-right: 0; }
}

/* Botón eliminar cliente junto al nombre, en la ficha del cliente */
.detalle-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.detalle-eliminar-cliente { font-size: 1.3rem; padding: 6px 8px; flex-shrink: 0; margin-top: 2px; }

/* Card de cliente: nombre / DNI / notificaciones, cada uno en su propia línea */
#cardsClientes .card-notif { justify-content: flex-start; }
#cardsClientes .card-notif .card-badge-lbl { margin-left: 0; font-size: .75rem; }

/* Documentos del cliente (DNI, firma, huella): si ya hay imagen en el cuadro,
   solo se ofrece la X para eliminarla (se ocultan Galería, Cámara y Descargar) */
.docs-grid .dropzone:has(.preview-img[src]:not([src=""])) .dropzone-btns { display: none; }

/* Botón "Póliza" junto al nombre del seguro, y modal para verla */
.cuenta-poliza-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid #1a73e8; background: #fff; color: #1a73e8;
  border-radius: 14px; padding: 3px 10px; font-size: .78rem; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.cuenta-poliza-btn:hover { background: #e8f0fe; }
.modal.modal-poliza { max-width: 900px; }
.poliza-visor { height: 70vh; border: 1px solid #e0e0e0; border-radius: 8px; overflow: hidden; background: #f5f5f5; margin-bottom: 12px; }
.poliza-visor iframe { width: 100%; height: 100%; border: none; }
.poliza-visor img { max-width: 100%; max-height: 100%; width: auto; height: auto; margin: auto; object-fit: contain; }
.poliza-visor:has(img[style*="block"]) { display: flex; align-items: center; justify-content: center; height: auto; max-height: 75vh; min-height: 200px; }
.img-ampliable { cursor: zoom-in; }

/* El botón eliminar cliente solo se muestra en la pestaña Datos Personales */
.detalle-page:has(#vista-personales:not(.active)) .detalle-eliminar-cliente { display: none; }
.cuenta-seg-acciones { flex-wrap: wrap; justify-content: flex-end; }

/* Reclamo sin imagen (se quitó desde "Editar reclamo") */
.recl-sin-img {
  width: 100%; height: 120px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  background: #f1f3f4; color: #888; font-size: .75rem; cursor: pointer; border-radius: 10px 10px 0 0;
}
.recl-sin-img i { font-size: 1.6rem; }

/* Pestaña Reclamos: cabecera de cada siniestro con el botón "Agregar reclamo" */
.recl-ap-cabecera { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; border-bottom: 1px solid #e3f2fd; padding-bottom: 6px; margin-bottom: 8px; }
.recl-ap-cabecera .recl-ap-titulo-primario { border-bottom: none; padding-bottom: 0; margin: 0; }
.recl-ap-agregar { padding: 6px 12px; font-size: .8rem; display: inline-flex; align-items: center; gap: 5px; }

/* Etiqueta con la fecha del siniestro en cada bloque de reclamos (solo si hay más de un siniestro) */
.recl-sin-tag { font-size: .7rem; font-weight: 600; color: #5f6368; background: #eef1f5; border-radius: 10px; padding: 2px 8px; margin-left: 6px; white-space: nowrap; }


/* Código de bloqueo de cada banco en la pestaña Reclamos */
.recl-codbloq {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; margin: 6px 0; border-radius: 8px;
  background: #f1f8e9; border: 1px solid #dcedc8; font-size: .82rem; color: #33691e;
}
.recl-codbloq-txt { display: inline-flex; align-items: center; gap: 6px; }
.recl-codbloq-falta { background: #fff5f5; border-color: #ffcdd2; color: #c62828; font-weight: 600; }

/* Botón de cuadro deshabilitado (p. ej. "Pegar" sin imagen en el portapapeles) */
button.btn-dropzone:disabled { opacity: .45; cursor: not-allowed; border-color: #b0b6bd; color: #8a9097; background: #f4f5f6; }
.recl-codbloq-txt { flex-wrap: wrap; }
.recl-codbloq-fecha { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: #558b2f; font-weight: 500; }

/* Evento: casilla "Espero respuesta" y aviso de a qué evento se responde */
/* Separación uniforme entre los campos de las ventanas (antes quedaban pegados) */
.modal form > * + .form-group { margin-top: 14px; }

.form-group label.eb-check {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid #d6dbe1; border-radius: 8px; background: #f8fafc;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.form-group label.eb-check:hover { border-color: #1a73e8; }
.form-group label.eb-check:has(input:checked) { border-color: #1a73e8; background: #e8f0fe; }
.form-group label.eb-check input[type="checkbox"] {
  width: 18px; height: 18px; margin: 0; padding: 0; flex-shrink: 0;
  accent-color: #1a73e8; cursor: pointer;
}
.eb-check-texto { display: flex; flex-direction: column; gap: 2px; }
.eb-check-titulo { font-size: .9rem; font-weight: 600; color: #333; }
.eb-check-ayuda { font-size: .76rem; font-weight: 400; color: #777; }
.eb-responde-a { background: #e8f0fe; color: #1a73e8; border-radius: 8px; padding: 8px 10px; font-size: .85rem; font-weight: 600; margin: 14px 0 0; }

/* Cuadros de la ventana de evento: crecen si los botones no caben en una línea */
#modalEventoBanco .dropzone { height: auto; min-height: 120px; }
#modalEventoBanco .dropzone .dropzone-btns { flex-wrap: wrap; justify-content: center; }

/* "Respuesta registrada" y "Respuesta a:" son enlaces que señalan el evento relacionado */
button.evt-respondido-enlace { cursor: pointer; font-family: inherit; color: #2e7d32; }   /* conserva el aspecto de la etiqueta verde */
button.evt-respondido-enlace:hover { background: #d7efd9; }
button.evento-enlace {
  border: none; background: none; padding: 0; cursor: pointer; font-family: inherit; text-align: left;
  display: flex; align-items: center; gap: 6px; color: #1a73e8; width: 100%;
}
button.evento-enlace:hover { text-decoration: underline; }
/* Evento señalado: borde y fondo que parpadean unos segundos */
.evento-item.evento-senalado { animation: eventoSenalado 2.6s ease-out; }
@keyframes eventoSenalado {
  0%, 30%, 60% { box-shadow: 0 0 0 3px #1a73e8; background: #e8f0fe; }
  15%, 45%     { box-shadow: 0 0 0 3px rgba(26,115,232,.25); background: #f4f8ff; }
  100%         { box-shadow: 0 0 0 0 rgba(26,115,232,0); }
}

/* Cuadro donde caerá la imagen al pegar con Ctrl + V (ventana de evento) */
#modalEventoBanco .dropzone.dropzone-activa { border-style: solid; background: #eaf2ff; position: relative; }
#modalEventoBanco .dropzone.dropzone-activa::after {
  content: 'Ctrl + V pega aquí';
  position: absolute; top: 6px; right: 8px;
  font-size: .68rem; font-weight: 700; color: #1a73e8; background: #fff; border: 1px solid #c6dafc; border-radius: 10px; padding: 1px 8px;
}

/* Archivos en lista vertical, estilo WhatsApp: miniatura o ícono grande + nombre + tipo */
.arch-lista { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; width: 100%; max-width: 340px; margin-left: auto; }
.arch-fila { display: flex; align-items: center; gap: 6px; background: #f3f6f9; border: 1px solid #e1e6eb; border-radius: 10px; overflow: hidden; }
.arch-abrir {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px;
  padding: 6px 10px 6px 6px; border: none; background: none; cursor: pointer; text-align: left; font-family: inherit;
}
.arch-abrir:hover { background: #e8eef5; }
.arch-mini { width: 52px; height: 52px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: #dfe5ea; }
.arch-icono { width: 52px; height: 52px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 2rem; flex-shrink: 0; }
.arch-icono-pdf { background: #fdecea; color: #d32f2f; }
.arch-icono-doc { background: #e3f2fd; color: #1565c0; }
.arch-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.arch-nombre { font-size: .86rem; font-weight: 600; color: #263238; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.arch-tipo { font-size: .72rem; color: #78838c; }
.arch-quitar { border: none; background: none; color: #e53935; cursor: pointer; font-size: 1.1rem; padding: 8px 12px; flex-shrink: 0; }
.arch-quitar:hover { background: #ffebee; }
.eb-evidencias-lista:has(.arch-fila) { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }

/* Vista previa de PDF y Word encima del nombre del archivo (estilo WhatsApp) */
.arch-pie { display: flex; align-items: center; gap: 10px; min-width: 0; width: 100%; }
.arch-fila.arch-con-prev .arch-abrir { flex-direction: column; align-items: stretch; gap: 6px; padding: 6px; }
.arch-prev {
  display: block; position: relative; width: 100%; height: 150px; overflow: hidden;
  background: #fff; border: 1px solid #e1e6eb; border-radius: 8px; pointer-events: none;
}
.arch-prev-img { display: block; width: 100%; height: auto; }
.arch-prev-hoja { position: absolute; top: 0; left: 0; transform-origin: top left; background: #fff; text-align: left; }
.arch-prev-hoja section { margin: 0 !important; box-shadow: none !important; min-height: 0 !important; }
.arch-prev-carga {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: .78rem; color: #90a0ab; background: #f7f9fb;
}
.arch-prev-carga i { animation: arch-gira 1s linear infinite; }
@keyframes arch-gira { to { transform: rotate(360deg); } }
.arch-fila.arch-con-prev .arch-icono { width: 38px; height: 38px; font-size: 1.5rem; }
.arch-fila.arch-con-prev .arch-quitar { align-self: flex-start; }
.arch-icono-img { background: #e8f5e9; color: #2e7d32; }
/* Imágenes: se ve todo el ancho; si es muy alta se recorta por abajo */
.arch-prev:has(.arch-prev-foto) { height: auto; min-height: 60px; max-height: 150px; }
.arch-prev-foto { min-height: 58px; object-fit: cover; object-position: top center; }

/* Archivos de un evento plegados: resumen con cantidades + flechita */
.arch-plegable { display: flex; flex-direction: column; align-items: flex-end; margin-top: 8px; }
.arch-lista[hidden] { display: none; }
.arch-plegable .arch-lista { margin-top: 6px; }
.arch-resumen {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  padding: 5px 10px; border: 1px solid #e1e6eb; border-radius: 16px; background: #f3f6f9;
  color: #455a64; font-family: inherit; font-size: .8rem; font-weight: 600; cursor: pointer;
}
.arch-resumen:hover { background: #e8eef5; }
.arch-cuenta { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.arch-cuenta i { font-size: 1rem; color: #1a73e8; }
.arch-flecha { font-size: .95rem; transition: transform .15s; }
.arch-plegable.abierto .arch-flecha { transform: rotate(180deg); }
.arch-cuentas { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 2px 12px; min-width: 0; }
.arch-flecha { flex-shrink: 0; }

/* Pestaña Documentos: grid de documentos de todos los clientes */
#tablaDocumentos { width: 100%; table-layout: fixed; }
#tablaDocumentos th, #tablaDocumentos td { max-width: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#tab-documentos { max-width: 1100px; }
#tablaDocumentos th:nth-child(2) { width: 150px; }
#tablaDocumentos th:nth-child(3) { width: 28%; }
#tablaDocumentos th:nth-child(4) { width: 104px; }
#tablaDocumentos th:nth-child(5) { width: 116px; }
#tablaDocumentos tbody tr { cursor: pointer; }
.doc-nombre { display: flex; align-items: center; gap: 10px; min-width: 0; }
.doc-nombre > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.doc-icono { width: 34px; height: 34px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; flex-shrink: 0; }
.doc-icono-pdf { background: #fdecea; color: #d32f2f; }
.doc-icono-doc { background: #e3f2fd; color: #1565c0; }
.doc-icono-img { background: #e8f5e9; color: #2e7d32; }
.doc-card { cursor: pointer; display: flex; align-items: center; gap: 12px; }
.doc-card .card-info { min-width: 0; flex: 1; }
.doc-card .card-nombre, .doc-card .card-detalle { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Menú principal (Clientes, Bancos, Documentos) en pantallas muy angostas:
   solo la pestaña activa muestra su nombre; las demás, solo el ícono */
@media (max-width: 430px) {
  .menu-lista { min-width: 0; }
  .menu-lista .sidebar-item { width: auto; flex: 0 0 auto; white-space: nowrap; }
  .menu-lista .sidebar-item:not(.active) span { display: none; }
}
.doc-card-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* "Registrar evento" + botón redondo con el signo más (al final de los eventos de un banco) */
.evento-registrar { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 10px; }
.evento-registrar-txt { font-size: .9rem; font-weight: 600; color: #1a73e8; cursor: pointer; }

/* Documentos: combo "Ordenar por" a la derecha del buscador y títulos de grupo */
.doc-orden { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: #555; white-space: nowrap; }
.doc-orden select {
  padding: 9px 12px; border: 1px solid #ccc; border-radius: 8px; font-size: .95rem; font-family: inherit;
  background: #fff; color: #333; outline: none; cursor: pointer;
}
.doc-orden select:focus { border-color: #1a73e8; }
#tablaDocumentos tbody tr.doc-grupo { cursor: default; }
#tablaDocumentos tr.doc-grupo td, .doc-grupo-card {
  background: #e8f0fe; color: #1a56b0; font-weight: 700; font-size: .9rem;
}
#tablaDocumentos tr.doc-grupo td > i, .doc-grupo-card > i { font-size: 1.05rem; vertical-align: -2px; }
.doc-grupo-card { padding: 8px 12px; border-radius: 8px; margin-top: 6px; display: flex; align-items: center; gap: 6px; }
.doc-grupo-card:first-child { margin-top: 0; }
.doc-grupo-card > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-grupo-n {
  display: inline-block; min-width: 22px; text-align: center; margin-left: 6px; padding: 0 7px;
  border-radius: 10px; background: #1a73e8; color: #fff; font-size: .75rem; font-weight: 700; line-height: 1.5;
}

/* Pie del menú principal: usuario con sesión iniciada + Cerrar sesión */
.sidebar-pie { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid rgba(255,255,255,.18); display: flex; flex-direction: column; gap: 6px; }
.sidebar-usuario { font-size: .78rem; color: #d6e4fb; padding: 0 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-salir {
  display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: none; color: #e8eefc;
  font-size: .95rem; font-family: inherit; padding: 11px 14px; border-radius: 8px; cursor: pointer; text-align: left;
}
.sidebar-salir i { font-size: 1.25rem; }
.sidebar-salir:hover { background: rgba(255,255,255,.14); color: #fff; }
@media (max-width: 600px) {
  .sidebar-pie { margin-top: 0; margin-left: auto; padding: 0; border-top: none; flex-direction: row; align-items: center; }
  .sidebar-usuario, .sidebar-salir span { display: none; }
  .sidebar-salir { width: auto; padding: 8px 10px; }
}
