:root {
  --cot-rojo: #e63946;
  --cot-rojo-hover: #c92a37;
  --cot-azul: #1d4ed8;
  --cot-verde-ok: #10b981;
  --cot-amarillo: #fbbf24;
  --cot-gris-bg: #f6f7fb;
  --cot-card-bg: #ffffff;
  --cot-border: #e5e7eb;
}

.cot-wrap {
  padding: 1.5rem 0 3rem;
  background: var(--cot-gris-bg);
  min-height: calc(100vh - 80px);
}
.cot-wrap > .container { max-width: 1320px; }

.cot-cabecera {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1rem;
}
.cot-cabecera h1 {
  font-size: 1.5rem;
  color: var(--color-secondary);
  margin: 0 0 0.25rem 0;
}
.cot-cabecera-acciones {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.cot-cabecera-acciones .btn { font-size: 0.875rem; padding: 0.5rem 1rem; }

/* Defensivo: [hidden] debe ganar a cualquier display explicito */
[hidden] { display: none !important; }

/* Banner de error inline (edad invalida, etc.) */
.cot-top-error {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-top: -0.5rem;
  margin-bottom: 1rem;
}
.cot-top-error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #b91c1c;
}

/* Top filter bar */
.cot-top-bar {
  background: #fff;
  border-radius: 14px;
  padding: 1.125rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: end;
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  border: 1px solid var(--cot-border);
}
.cot-top-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
  flex: 1 1 160px;
  max-width: 280px;
}
.cot-top-field label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
}
.cot-top-control {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--cot-border);
  border-radius: 10px;
  transition: border-color 120ms, box-shadow 120ms;
  min-width: 0;
}
.cot-top-control:focus-within {
  border-color: var(--cot-azul);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.cot-top-field input,
.cot-top-field select {
  flex: 1;
  width: 100%;
  padding: 0.65rem 0.875rem;
  border: 0;
  border-radius: 10px;
  font-size: 0.9375rem;
  background: transparent;
  outline: none;
  color: #111827;
  min-width: 0;
}
.cot-top-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%23667085'%3E%3Cpath d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 10px;
  padding-right: 2rem;
  cursor: pointer;
}
.cot-top-prefix {
  padding-left: 0.875rem;
  color: #6b7280;
  font-size: 0.9375rem;
  font-weight: 500;
  pointer-events: none;
}
.cot-top-prefix + input { padding-left: 0.375rem; }

.cot-top-field input::placeholder { color: #9ca3af; }
.cot-top-field input[type="number"]::-webkit-outer-spin-button,
.cot-top-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cot-top-field input[type="number"] { -moz-appearance: textfield; }

.cot-top-field.edad-lista .cot-top-control { border-color: var(--cot-verde-ok); background: #f0fdf4; }

/* Pill (Edad lista) y chips de accion (Agregar titular/beneficiario) */
.cot-top-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: #ecfdf5;
  color: var(--cot-verde-ok);
  border: 1px solid var(--cot-verde-ok);
  border-radius: 999px;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  height: 42px;
  align-self: end;
  flex: 0 0 auto;
}
.cot-top-pill-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--cot-verde-ok);
  color: #fff;
  font-size: 0.6875rem;
  font-weight: 700;
}
.cot-chip-add {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  background: #fff;
  color: #374151;
  border: 1px solid var(--cot-border);
  border-radius: 999px;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms, border-color 120ms, color 120ms;
  height: 42px;
  align-self: end;
  flex: 0 0 auto;
}
.cot-chip-add:hover:not(:disabled) {
  background: #f9fafb;
  border-color: #9ca3af;
  color: #111827;
}
.cot-chip-add:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: #f3f4f6;
}
.cot-chip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-weight: 700;
  color: #6b7280;
}

/* Lista de asegurados activos (chips abajo del top bar) */
.cot-asegurados-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.cot-chip-asegurado {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  border: 1px solid var(--cot-azul);
  color: var(--cot-azul);
  border-radius: 999px;
  padding: 0.375rem 0.5rem 0.375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}
.cot-chip-asegurado-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: transparent;
  color: var(--cot-azul);
  border: 0;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}
.cot-chip-asegurado-x:hover { background: #eff6ff; color: #dc2626; }

/* Modal */
.cot-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cot-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
}
.cot-modal-card {
  position: relative;
  background: #fff;
  border-radius: 14px;
  padding: 1.5rem 1.5rem 1.25rem;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  z-index: 1;
}
.cot-modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: transparent;
  border: 0;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 1.25rem;
  color: #6b7280;
  cursor: pointer;
}
.cot-modal-close:hover { background: #f3f4f6; color: #111827; }
.cot-modal-titulo {
  margin: 0 0 0.25rem 0;
  font-size: 1.125rem;
  color: var(--cot-azul);
  font-weight: 700;
}
.cot-modal-sub {
  margin: 0 0 1.125rem 0;
  font-size: 0.8125rem;
  color: #6b7280;
}
.cot-modal-field { margin-bottom: 1rem; }
.cot-modal-field label {
  display: block;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 0.375rem;
}
.cot-modal-field input {
  width: 100%;
  padding: 0.65rem 0.875rem;
  border: 1px solid var(--cot-rojo);
  border-radius: 10px;
  font-size: 0.9375rem;
  outline: none;
}
.cot-modal-field input:focus {
  border-color: var(--cot-azul);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.cot-modal-field input[type="number"]::-webkit-outer-spin-button,
.cot-modal-field input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: auto; }
.cot-modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}
.cot-modal-actions .cot-btn-secondary,
.cot-modal-actions .cot-btn-rojo { flex: 1; }
.cot-btn-secondary {
  background: #fff;
  color: #374151;
  border: 1px solid var(--cot-border);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: background 120ms;
}
.cot-btn-secondary:hover { background: #f9fafb; }

/* Modal vista WhatsApp */
.cot-modal-wa { padding: 1rem; }
.cot-modal-card-wa {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  background: #ede4d3;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.3);
  z-index: 1;
}
.cot-wa-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: #0a7869;
  color: #fff;
  padding: 0.875rem 1rem;
}
.cot-wa-back {
  background: rgba(255,255,255,0.15);
  border: 0;
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 1.125rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cot-wa-back:hover { background: rgba(255,255,255,0.25); }
.cot-wa-icono {
  background: #fff;
  color: #0a7869;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.cot-wa-titulo-wrap { flex: 1; min-width: 0; }
.cot-wa-titulo {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.1;
}
.cot-wa-subtitulo {
  font-size: 0.75rem;
  opacity: 0.85;
  margin-top: 2px;
}

.cot-wa-tabs {
  display: flex;
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}
.cot-wa-tab {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 0.875rem 0.5rem;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: #6b7280;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  text-transform: uppercase;
}
.cot-wa-tab.is-active {
  color: #0a7869;
  border-bottom-color: #0a7869;
  background: #fff;
}
.cot-wa-tab:hover:not(.is-active) { background: #ebebeb; }

.cot-wa-cuerpo {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background: #ede4d3;
}
.cot-wa-mensaje {
  background: #fff;
  border: 1px solid #e8d9b8;
  border-radius: 8px;
  padding: 0.875rem 1rem;
  font-size: 0.875rem;
  color: #1f2937;
  line-height: 1.45;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  word-break: break-word;
}
.cot-wa-msg-titulo { font-weight: 700; margin: 0 0 0.25rem; }
.cot-wa-msg-bloque { margin-top: 0.625rem; }
.cot-wa-msg-bloque:first-child { margin-top: 0; }
.cot-wa-msg-bloque > div { margin: 0; }
.cot-wa-msg-bloque-h { font-weight: 700; margin: 0 0 0.125rem; }
.cot-wa-msg-vacio { font-style: italic; color: #9ca3af; font-size: 0.8125rem; }
.cot-wa-msg-link { color: #0369a1; word-break: break-all; }
.cot-wa-msg-cob { display: flex; align-items: flex-start; gap: 0.375rem; padding: 0.25rem 0; cursor: pointer; user-select: none; }
.cot-wa-msg-cob input { margin-top: 0.25rem; accent-color: #0a7869; }
.cot-wa-msg-cob.is-marcado { font-weight: 700; }

.cot-wa-paginacion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #ede4d3;
  border-top: 1px solid #d6c9af;
}
.cot-wa-pag-btn {
  background: rgba(255,255,255,0.7);
  border: 1px solid #d6c9af;
  border-radius: 999px;
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  color: #374151;
  cursor: pointer;
  font-weight: 600;
}
.cot-wa-pag-btn:hover:not(:disabled) { background: #fff; }
.cot-wa-pag-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cot-wa-pag-info { text-align: center; }
.cot-wa-pag-num { font-weight: 700; color: #1f2937; font-size: 0.9375rem; }
.cot-wa-pag-sub { font-size: 0.75rem; color: #6b7280; margin-top: 2px; }

.cot-wa-footer {
  display: flex;
  align-items: stretch;
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
}
.cot-wa-foot-btn {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  color: #6b7280;
  border-right: 1px solid #e0e0e0;
}
.cot-wa-foot-btn:last-child { border-right: 0; }
.cot-wa-foot-btn:hover { background: #ebebeb; color: #1f2937; }
.cot-wa-foot-icon { display: inline-flex; align-items: center; justify-content: center; font-size: 1rem; }
.cot-wa-foot-lbl { font-size: 0.6875rem; font-weight: 600; }
.cot-wa-foot-btn-primary { color: #0a7869; }
.cot-wa-foot-btn-primary:hover { color: #0a7869; }

/* Modal grande (beneficios complementarios) */
.cot-modal-xl { padding: 1.5rem; }
.cot-modal-card-xl {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  z-index: 1;
  overflow: hidden;
}
.cot-bene-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: #fef3c7;
  border-bottom: 1px solid #fcd34d;
}
.cot-bene-header .cot-modal-titulo {
  flex: 1;
  margin: 0;
  font-size: 1.125rem;
  color: var(--cot-azul);
}
.cot-bene-isapre {
  display: flex;
  align-items: center;
  background: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--cot-border);
  height: 40px;
}
.cot-bene-isapre img { max-height: 28px; width: auto; }
.cot-bene-header .cot-modal-close {
  position: static;
}

.cot-bene-legend {
  display: flex;
  gap: 1.25rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.8125rem;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
}
.cot-bene-legend-item { display: inline-flex; align-items: center; gap: 0.375rem; }
.cot-bene-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  display: inline-block;
}
.cot-bene-dot-gris { background: #9ca3af; }
.cot-bene-dot-rojo { background: var(--cot-rojo); }

.cot-bene-tabla-wrap {
  flex: 1;
  overflow-y: auto;
  padding: 0 1.25rem;
}
.cot-bene-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.cot-bene-tabla thead th {
  position: sticky;
  top: 0;
  background: #fff;
  text-align: left;
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #6b7280;
  font-weight: 700;
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid #e5e7eb;
}
.cot-bene-th-center { text-align: center !important; }
.cot-bene-th-right { text-align: right !important; }
.cot-bene-tabla tbody tr {
  border-bottom: 1px solid #f3f4f6;
}
.cot-bene-tabla tbody td {
  padding: 0.625rem 0.5rem;
  vertical-align: middle;
}
.cot-bene-tabla tbody td.cot-bene-td-center { text-align: center; }
.cot-bene-tabla tbody td.cot-bene-td-right { text-align: right; font-weight: 700; }

.cot-bene-badge {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.cot-bene-badge-interno { background: #fce7f3; color: #be185d; }

.cot-bene-counter {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--cot-border);
  border-radius: 999px;
  overflow: hidden;
}
.cot-bene-counter button {
  background: transparent;
  border: 0;
  width: 28px;
  height: 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  color: #374151;
}
.cot-bene-counter button:hover:not(:disabled) { background: #f3f4f6; }
.cot-bene-counter button:disabled { color: #d1d5db; cursor: not-allowed; }
.cot-bene-counter .cot-bene-counter-val {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 0.875rem;
}

.cot-bene-aplicar-chk {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: #6b7280;
  cursor: pointer;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.cot-bene-aplicar-chk input { cursor: pointer; accent-color: var(--cot-rojo); }
.cot-bene-aplicar-chk:has(input:checked) {
  background: var(--cot-rojo);
  color: #fff;
  border-color: var(--cot-rojo);
  font-weight: 600;
}
.cot-bene-aplicar-chk:has(input:checked) input { accent-color: #fff; }
.cot-bene-max-hint {
  margin-top: 0.25rem;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--cot-rojo);
  letter-spacing: 0.05em;
}
.cot-bene-factor-calc {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--cot-rojo);
  margin-top: 0.125rem;
}
.cot-bene-tabla tbody tr.cot-bene-fila-aplicada {
  background: #fef3c7;
}
.cot-bene-tabla tbody tr.cot-bene-fila-aplicada td { font-weight: 500; }
.cot-bene-tabla tbody tr.cot-bene-fila-aplicada td:nth-child(3) { font-weight: 700; }

.cot-bene-pdf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: #fef2f2;
  color: var(--cot-rojo);
  border: 1px solid #fecaca;
  font-weight: 700;
  font-size: 0.75rem;
  text-decoration: none;
}
.cot-bene-pdf:hover { background: #fee2e2; }
.cot-bene-pdf.disabled { opacity: 0.4; pointer-events: none; }

.cot-bene-empty {
  padding: 2.5rem 1rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.9375rem;
}

.cot-bene-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  flex-wrap: wrap;
}
.cot-bene-summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #047857;
  font-weight: 600;
}
.cot-bene-sep { color: #9ca3af; }
.cot-bene-todos {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: #4b5563;
  cursor: pointer;
  margin-left: auto;
}
.cot-bene-todos input { cursor: pointer; }
.cot-bene-actions { display: flex; gap: 0.5rem; }
.cot-bene-actions .cot-btn-secondary,
.cot-bene-actions .cot-btn-rojo { padding: 0.5rem 1rem; }

/* Indicador en plan card cuando hay beneficios aplicados */
.plan-card-bene-aplicados {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: #047857;
  font-weight: 600;
}

@media (max-width: 800px) {
  .cot-bene-tabla thead { display: none; }
  .cot-bene-tabla tbody tr {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    padding: 0.5rem 0;
  }
  .cot-bene-tabla tbody td { padding: 0.25rem; font-size: 0.8125rem; }
  .cot-bene-footer { flex-direction: column; align-items: stretch; }
  .cot-bene-todos { margin-left: 0; }
}

/* Typeahead */
.cot-typeahead { position: relative; }
.cot-typeahead-chevron {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #6b7280;
  margin-right: 0.875rem;
  flex-shrink: 0;
  pointer-events: none;
}
.cot-typeahead-pop {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--cot-border);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.05);
  max-height: 320px;
  overflow-y: auto;
  z-index: 30;
  padding: 0.25rem;
}
.cot-typeahead-opt {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  color: #1f2937;
  cursor: pointer;
  border-radius: 6px;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.cot-typeahead-opt:hover,
.cot-typeahead-opt.is-active { background: #eff6ff; color: var(--cot-azul); }
.cot-typeahead-opt[data-idx="-1"] {
  font-weight: 600;
  color: #6b7280;
  border-bottom: 1px solid var(--cot-border);
  border-radius: 6px 6px 0 0;
  margin-bottom: 0.25rem;
}
.cot-typeahead-opt[data-idx="-1"]:hover { color: var(--cot-azul); background: #eff6ff; }
.cot-typeahead-tag {
  font-size: 0.625rem;
  background: #f3f4f6;
  color: #6b7280;
  padding: 0.125rem 0.375rem;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.cot-typeahead-empty {
  padding: 1rem;
  text-align: center;
  font-size: 0.875rem;
  color: #9ca3af;
}

.cot-top-action { display: flex; align-items: stretch; }
.cot-btn-rojo {
  background: var(--cot-rojo);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.65rem 1.5rem;
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms;
  height: 100%;
  min-height: 42px;
}
.cot-btn-rojo:hover { background: var(--cot-rojo-hover); }

@media (max-width: 1100px) {
  .cot-top-bar { gap: 0.75rem 0.875rem; }
  .cot-top-field { flex: 1 1 calc(50% - 1rem); }
  .cot-top-action { flex: 1 1 100%; }
  .cot-btn-rojo { width: 100%; }
}
@media (max-width: 560px) {
  .cot-top-bar {
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    gap: 0.875rem;
  }
  .cot-top-field {
    width: 100%;
    max-width: 380px;
    flex: 0 0 auto;
  }
  .cot-top-action {
    width: 100%;
    max-width: 380px;
  }
}

/* Grid */
.cot-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
}
/* Filtros avanzados como drawer en mobile */
.cot-filtros-btn { display: none; }
.cot-filtros-close { display: none; }
@media (max-width: 980px) {
  .cot-grid { grid-template-columns: 1fr; }
  .cot-sidebar { display: none !important; }
  .cot-sidebar.is-open {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: var(--cot-gris-bg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 1rem 1rem calc(5rem + env(safe-area-inset-bottom, 0px));
    gap: 0.75rem;
  }
  .cot-filtros-close {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    background: var(--cot-gris-bg);
    padding: 0.5rem 0 0.75rem;
    margin: 0 0 0.5rem;
    border-bottom: 1px solid var(--cot-border);
    z-index: 1;
  }
  .cot-filtros-close button {
    background: var(--cot-azul);
    color: #fff;
    border: 0;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.875rem;
  }
  .cot-filtros-close-titulo {
    font-weight: 700;
    color: var(--color-secondary);
    font-size: 1rem;
  }
  .cot-filtros-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: fixed;
    bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
    left: 1rem;
    background: var(--cot-azul);
    color: #fff;
    border: 0;
    padding: 0.75rem 1.125rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.875rem;
    cursor: pointer;
    box-shadow: 0 12px 24px -10px rgba(0,0,0,0.35);
    z-index: 1000;
  }
  .cot-filtros-btn svg { width: 16px; height: 16px; }
}

/* Sidebar */
.cot-sidebar {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}
.cot-box {
  background: #fff;
  border: 1px solid var(--cot-border);
  border-radius: 10px;
  padding: 0.875rem 1rem;
}
.cot-box h4 {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #4b5563;
  margin: 0 0 0.75rem 0;
  font-weight: 700;
}

.cot-rango {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  margin-bottom: 0.625rem;
}
.cot-rango input {
  flex: 1;
  padding: 0.5rem;
  border: 1px solid var(--cot-border);
  border-radius: 999px;
  font-size: 0.875rem;
  width: 100%;
  text-align: center;
  background: #fff;
}
.cot-rango span { color: #9ca3af; }
.cot-rango-cob label {
  display: block;
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.375rem;
  font-weight: 600;
}

/* Dual-range slider (basado en patron de elmejorplan) */
.cot-range {
  position: relative;
  height: 22px;
  margin: 0.5rem 8px 0.25rem;
}
.cot-range-track {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: #e5e7eb;
  border-radius: 4px;
  pointer-events: none;
}
.cot-range-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 4px;
  background: var(--cot-rojo);
  border-radius: 4px;
  pointer-events: none;
  left: 0;
  right: 0;
}
.cot-range input[type="range"] {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
}
.cot-range input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border: 0;
}
.cot-range input[type="range"]::-moz-range-track {
  height: 4px;
  background: transparent;
  border: 0;
}
.cot-range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cot-rojo);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  cursor: pointer;
  margin-top: -7px;
}
.cot-range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cot-rojo);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  cursor: pointer;
}
.cot-range input.cot-range-min { z-index: 1; }
.cot-range input.cot-range-max { z-index: 2; }
.cot-range.cot-range-min-on-top input.cot-range-min { z-index: 2; }
.cot-range.cot-range-min-on-top input.cot-range-max { z-index: 1; }

.cot-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.6875rem;
  color: #6b7280;
  margin: 0.375rem 0.5rem 0.5rem;
  font-weight: 600;
}

.cot-uf-boxes { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin-top: 0.5rem; }
.cot-uf-box {
  background: #fff;
  border: 1px solid var(--cot-border);
  border-radius: 6px;
  padding: 0.5rem;
  text-align: center;
}
.cot-uf-box-label { font-size: 0.6875rem; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.cot-uf-box-valor { font-size: 1.125rem; font-weight: 800; color: var(--cot-rojo); margin-top: 0.125rem; }

.cot-uf-hoy {
  background: #fde2e3;
  border: 1px solid #fbcfd1;
  border-radius: 6px;
  padding: 0.625rem;
  margin-top: 0.5rem;
  text-align: center;
}
.cot-uf-hoy-label { font-size: 0.6875rem; color: #b91c1c; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.cot-uf-hoy-valor { font-size: 1.125rem; font-weight: 800; color: var(--cot-rojo); margin-top: 0.125rem; }

.cot-7-aprox {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 0.625rem;
  margin-top: 0.5rem;
  text-align: center;
}
.cot-7-aprox-label { font-size: 0.6875rem; color: #b45309; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 700; }
.cot-7-aprox-valor { font-size: 1.125rem; font-weight: 800; color: #92400e; margin-top: 0.125rem; }

.cot-checkbox-list { display: flex; flex-direction: column; gap: 0.375rem; }
.cot-checkbox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
  cursor: pointer;
  padding: 0.125rem 0;
}
.cot-checkbox-item label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  flex: 1;
  user-select: none;
}
.cot-checkbox-item input[type="checkbox"] {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: var(--cot-azul);
}
.cot-checkbox-count {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 4px;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  min-width: 44px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s;
}
.cot-checkbox-count:hover {
  background: #e5e7eb;
  color: var(--color-secondary);
}
.cot-checkbox-count.cot-count-todos {
  background: var(--cot-azul);
  color: #fff;
  border-color: var(--cot-azul);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.cot-checkbox-count.cot-count-todos:hover {
  background: #1e40af;
  color: #fff;
}

/* Main / Resultados */
.cot-main { display: flex; flex-direction: column; gap: 0.75rem; }
.cot-main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.cot-resultados-num {
  background: var(--cot-azul);
  color: #fff;
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8125rem;
  font-weight: 700;
}
.cot-orden-wrap { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.cot-orden-wrap select {
  padding: 0.375rem 0.625rem;
  border: 1px solid var(--cot-border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: #fff;
}

.cot-paginacion {
  display: flex;
  justify-content: center;
  gap: 0.375rem;
  align-items: center;
  font-size: 0.875rem;
  padding: 0.25rem;
}
.cot-paginacion button {
  background: #fff;
  border: 1px solid var(--cot-border);
  border-radius: 4px;
  padding: 0.375rem 0.625rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--color-text);
}
.cot-paginacion button:disabled { opacity: 0.4; cursor: not-allowed; }
.cot-paginacion button.activa {
  background: var(--cot-azul);
  color: #fff;
  border-color: var(--cot-azul);
}

.cot-lista { display: flex; flex-direction: column; gap: 0.75rem; }
.cot-loading,
.cot-empty {
  background: #fff;
  border: 1px solid var(--cot-border);
  border-radius: 10px;
  padding: 2.5rem;
  text-align: center;
  color: #6b7280;
}

/* Plan card · color de marca por isapre */
.plan-card {
  background: var(--cot-card-bg);
  border: 1px solid var(--cot-border);
  border-radius: 10px;
  display: grid;
  grid-template-columns: 230px 1fr 220px;
  overflow: hidden;
  border-top: 4px solid var(--plan-color, var(--cot-azul));
  --plan-color: #2563eb;
}
.plan-card[data-color="rojo"]  { --plan-color: #dc2626; }
.plan-card[data-color="verde"] { --plan-color: #0d9488; }
.plan-card[data-color="azul"]  { --plan-color: #2563eb; }
@media (max-width: 980px) {
  .plan-card { grid-template-columns: 1fr; }
}

.plan-card-izq {
  padding: 1rem;
  border-right: 1px solid var(--cot-border);
}
.plan-card-isapre {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.plan-card-isapre img { max-height: 28px; max-width: 100px; object-fit: contain; }
.plan-card-isapre span { font-weight: 700; color: var(--color-secondary); font-size: 0.9375rem; }
.plan-card-nombre {
  font-weight: 700;
  color: var(--color-secondary);
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}
.plan-card-cod {
  font-size: 0.8125rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}
.plan-card-cod strong { color: var(--color-secondary); }
.badge-tipo {
  display: inline-block;
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.375rem;
  text-transform: lowercase;
  font-weight: 600;
}
.badge-tipo.primary { background: #dbeafe; color: #1e40af; }
.badge-tipo.warning { background: #fef3c7; color: #b45309; }
.badge-tipo.danger { background: #fee2e2; color: #991b1b; }
.plan-card-region {
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: #6b7280;
  font-weight: 700;
  margin-bottom: 0.375rem;
}
.plan-card-base {
  font-size: 0.8125rem;
  color: #6b7280;
}
.plan-card-base strong { color: var(--color-secondary); font-weight: 700; }

.plan-card-centro {
  padding: 1rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.cobertura-col h5 {
  font-size: 0.6875rem;
  letter-spacing: 0.04em;
  color: var(--color-secondary);
  margin: 0 0 0.5rem 0;
  text-transform: uppercase;
  font-weight: 700;
  border-bottom: 1px solid var(--cot-border);
  padding-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.375rem;
}
.cobertura-col h5 svg { flex-shrink: 0; width: 12px; height: 12px; }
.cobertura-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.75rem;
  line-height: 1.55;
}
.cobertura-col li { color: var(--plan-color); }
.cobertura-col li b { color: var(--plan-color); font-weight: 700; margin-right: 0.25rem; }
.cobertura-col .sin-cobertura { color: #9ca3af; font-style: italic; }
.cobertura-col li.cobertura-match {
  background: #fef3c7;
  border-radius: 4px;
  padding: 2px 6px;
  margin: 0 -4px 2px;
  font-weight: 600;
}
.cobertura-col li.cobertura-match b { color: var(--plan-color); }

.plan-card-der {
  padding: 1rem;
  border-left: 1px solid var(--cot-border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
  justify-content: center;
}
.plan-card-precio-clp-grande {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--plan-color);
  text-align: center;
  line-height: 1.1;
}
.plan-card-precio-uf-chico {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
  margin-bottom: 0.25rem;
}
.plan-card-precio-uf {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--plan-color);
  text-align: center;
}
.plan-card-precio-clp {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-secondary);
  text-align: center;
}
.plan-card-precio-nota {
  font-size: 0.6875rem;
  color: #6b7280;
  text-align: center;
  font-style: italic;
  margin-bottom: 0.25rem;
}
.plan-card-precio-adic {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--cot-rojo);
  text-align: center;
  margin: 0.125rem 0 0.5rem;
}
/* Buscador de plan (codigo, nombre, clinica) */
.cot-buscador-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--cot-border);
  border-radius: 10px;
  padding: 0 0.75rem;
  margin-bottom: 0.875rem;
  transition: border-color 120ms, box-shadow 120ms;
}
.cot-buscador-wrap:focus-within {
  border-color: var(--cot-azul);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.cot-buscador-icon {
  display: inline-flex;
  align-items: center;
  color: #6b7280;
  flex-shrink: 0;
}
.cot-buscador {
  flex: 1;
  border: 0;
  outline: none;
  background: transparent;
  padding: 0.65rem 0.5rem;
  font-size: 0.9375rem;
  color: #111827;
  min-width: 0;
}
.cot-buscador::placeholder { color: #9ca3af; }
.cot-buscador-clear {
  background: transparent;
  border: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  font-size: 1.125rem;
  color: #6b7280;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cot-buscador-clear:hover { background: #f3f4f6; color: #111827; }

.plan-card.plan-card-recien-modificado {
  animation: plan-card-pulse 2.4s ease-out;
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.45);
}
@keyframes plan-card-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(13, 148, 136, 0.6); }
  20%  { box-shadow: 0 0 0 8px rgba(13, 148, 136, 0.35); }
  100% { box-shadow: 0 0 0 3px rgba(13, 148, 136, 0); }
}
.plan-card-der .btn-card {
  padding: 0.5rem;
  border: 1px solid var(--plan-color);
  background: #fff;
  color: var(--plan-color);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s;
}
.plan-card-der .btn-card:hover {
  background: color-mix(in srgb, var(--plan-color) 8%, #fff);
}
.plan-card-der .btn-card.btn-card-primary {
  background: var(--plan-color);
  color: #fff;
}
.plan-card-der .btn-card.btn-card-primary:hover {
  filter: brightness(0.92);
}
.plan-card-der .btn-card[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.plan-card-der .btn-card.btn-card-bene-aplicado {
  background: #0d9488;
  color: #fff;
  border-color: #0d9488;
}
.plan-card-der .btn-card.btn-card-bene-aplicado:hover {
  background: #0f766e;
}
.plan-card-der .btn-card.btn-card-whatsapp {
  background: #25D366;
  color: #fff;
  border-color: #25D366;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
}
.plan-card-der .btn-card.btn-card-whatsapp:hover {
  background: #1ebd5b;
  border-color: #1ebd5b;
}
.plan-card-der .btn-card.btn-card-whatsapp svg {
  flex-shrink: 0;
}
