/* ═══════════════════════════════════════════════════════
   COASMEDAS Simulador de Crédito — Estilos
   Prefijo: .coasmedas-
   ═══════════════════════════════════════════════════════ */

:root {
  --coas-primary:        #005BAA;
  --coas-primary-dark:   #004488;
  --coas-primary-light:  #e8f0f9;
  --coas-accent:         #F5A800;
  --coas-accent-dark:    #c98900;
  --coas-text:           #1a1a1a;
  --coas-text-muted:     #666666;
  --coas-border:         #d0d7e0;
  --coas-error-bg:       #fff0f0;
  --coas-error-border:   #e53e3e;
  --coas-error-text:     #c53030;
  --coas-warn-bg:        #fff8e1;
  --coas-warn-border:    #f59e0b;
  --coas-warn-text:      #92400e;
  --coas-row-even:       #ffffff;
  --coas-row-odd:        #f7f9fc;
  --coas-radius:         8px;
  --coas-shadow:         0 8px 32px rgba(0, 0, 0, 0.22);
}

/* ── No-scroll when modal open ── */
body.coasmedas-no-scroll {
  overflow: hidden;
}

/* ── Trigger button ── */
.coasmedas-trigger-btn {
  display: inline-block;
  background-color: var(--coas-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--coas-radius);
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.coasmedas-trigger-btn:hover,
.coasmedas-trigger-btn:focus {
  background-color: var(--coas-primary-dark);
  outline: 3px solid var(--coas-accent);
  outline-offset: 2px;
}

/* ── Modal overlay ── */
.coasmedas-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  padding: 16px;
  box-sizing: border-box;
}

/* ── Modal box ── */
.coasmedas-modal-box {
  position: relative;
  background: #ffffff;
  border-radius: var(--coas-radius);
  box-shadow: var(--coas-shadow);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px 28px 28px;
  box-sizing: border-box;
}

/* ── Close button ── */
.coasmedas-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: var(--coas-primary);
  border: none;
  border-radius: var(--coas-radius);
  width: 40px;
  height: 40px;
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}
.coasmedas-close:hover,
.coasmedas-close:focus {
  background: var(--coas-primary-dark);
  outline: none;
}

/* ── Title ── */
.coasmedas-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--coas-primary);
  margin: 0 0 24px;
  padding-right: 32px;
}

/* ── Error box ── */
.coasmedas-error-box {
  background: var(--coas-error-bg);
  border: 1px solid var(--coas-error-border);
  color: var(--coas-error-text);
  border-radius: var(--coas-radius);
  padding: 10px 16px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

/* ── Warning ── */
.coasmedas-warn {
  background: var(--coas-warn-bg);
  border: 1px solid var(--coas-warn-border);
  color: var(--coas-warn-text);
  border-radius: var(--coas-radius);
  padding: 10px 16px;
  font-size: 0.875rem;
  margin: 12px 0;
}

/* ── Form grid ── */
.coasmedas-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 20px;
}

/* ── Field ── */
.coasmedas-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.coasmedas-field label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--coas-text);
}
.coasmedas-field input,
.coasmedas-field select {
  padding: 9px 12px;
  border: 1px solid var(--coas-border);
  border-radius: 6px;
  font-size: 0.95rem;
  color: var(--coas-text);
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
  width: 100%;
}
.coasmedas-field input:focus,
.coasmedas-field select:focus {
  outline: none;
  border-color: var(--coas-primary);
  box-shadow: 0 0 0 3px rgba(0, 91, 170, 0.15);
}
.coasmedas-hint {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--coas-text-muted);
  margin-left: 4px;
}

/* ── Actions ── */
.coasmedas-form-actions {
  margin-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ── Primary button ── */
.coasmedas-btn-primary {
  background-color: var(--coas-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--coas-radius);
  padding: 12px 32px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}
.coasmedas-btn-primary:hover,
.coasmedas-btn-primary:focus {
  background-color: var(--coas-primary-dark);
  outline: 3px solid var(--coas-accent);
  outline-offset: 2px;
}

/* ── Secondary button ── */
.coasmedas-btn-secondary {
  background-color: transparent;
  color: var(--coas-primary);
  border: 2px solid var(--coas-primary);
  border-radius: var(--coas-radius);
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}
.coasmedas-btn-secondary:hover,
.coasmedas-btn-secondary:focus {
  background-color: var(--coas-primary-light);
  outline: 3px solid var(--coas-accent);
  outline-offset: 2px;
}

/* ── Summary cards ── */
.coasmedas-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.coasmedas-card {
  background: var(--coas-primary-light);
  border: 1px solid var(--coas-border);
  border-radius: var(--coas-radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.coasmedas-card--highlight {
  background: var(--coas-primary);
  border-color: var(--coas-primary-dark);
}
.coasmedas-card--highlight .coasmedas-card-label,
.coasmedas-card--highlight .coasmedas-card-value {
  color: #ffffff;
}
.coasmedas-card-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--coas-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.coasmedas-card-value {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--coas-primary);
}

/* ── Amortization table wrapper (scroll) ── */
.coasmedas-table-wrap {
  overflow-x: auto;
  border-radius: var(--coas-radius);
  border: 1px solid var(--coas-border);
}

/* ── Table ── */
.coasmedas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.845rem;
  min-width: 680px;
}
.coasmedas-table thead tr {
  background: var(--coas-primary);
  color: #ffffff;
}
.coasmedas-table th {
  padding: 10px 12px;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
.coasmedas-table th:first-child,
.coasmedas-table td:first-child {
  text-align: center;
}
.coasmedas-table th:nth-child(2),
.coasmedas-table td:nth-child(2) {
  text-align: center;
}
.coasmedas-table td {
  padding: 8px 12px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--coas-border);
}
.coasmedas-row-even { background: var(--coas-row-even); }
.coasmedas-row-odd  { background: var(--coas-row-odd); }
.coasmedas-col-total {
  font-weight: 700;
  color: var(--coas-primary);
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .coasmedas-modal-box {
    padding: 20px 14px 20px;
  }
  .coasmedas-title {
    font-size: 1.15rem;
  }
  .coasmedas-cards {
    grid-template-columns: 1fr 1fr;
  }
  .coasmedas-btn-primary,
  .coasmedas-btn-secondary {
    width: 100%;
    text-align: center;
  }
}
@media (max-width: 380px) {
  .coasmedas-cards {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════
   COASMEDAS Simulador de Auxilios Solidarios
   Prefijo: .coasmedas-aux-
   ═══════════════════════════════════════════════════════ */

/* ── Grupos / secciones colapsables ── */
.coasmedas-aux-group {
  border: 1px solid var(--coas-border);
  border-radius: var(--coas-radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.coasmedas-aux-group-header {
  background: var(--coas-primary-light);
  padding: 12px 16px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--coas-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.coasmedas-aux-group-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Fila de beneficio ── */
.coasmedas-aux-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}
.coasmedas-aux-row-label {
  flex: 1 1 200px;
  font-size: 0.9rem;
  color: var(--coas-text);
  padding-top: 6px;
}
.coasmedas-aux-row-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Toggle SI/NO ── */
.coasmedas-toggle {
  display: inline-flex;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--coas-border);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.coasmedas-toggle span {
  padding: 5px 14px;
  background: #f0f0f0;
  color: var(--coas-text-muted);
  transition: background 0.15s, color 0.15s;
  line-height: 1.4;
}
.coasmedas-toggle span:first-child {
  border-right: 1px solid var(--coas-border);
}
.coasmedas-toggle[data-val="si"] span:first-child {
  background: #16a34a;
  color: #fff;
}
.coasmedas-toggle[data-val="no"] span:last-child {
  background: #e5e7eb;
  color: #374151;
}

/* ── Extra input after toggle ── */
.coasmedas-aux-extra {
  display: none;
  align-items: center;
  gap: 6px;
  animation: coasFadeIn 0.15s ease;
}
.coasmedas-aux-extra.visible {
  display: flex;
}
.coasmedas-aux-extra input[type="number"],
.coasmedas-aux-extra select {
  width: 90px;
  padding: 5px 8px;
  border: 1px solid var(--coas-border);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--coas-text);
}
.coasmedas-aux-extra select {
  width: auto;
  min-width: 160px;
}
.coasmedas-aux-extra label {
  font-size: 0.8rem;
  color: var(--coas-text-muted);
  white-space: nowrap;
}

/* ── Invalidez radio-cards ── */
.coasmedas-aux-radio-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.coasmedas-aux-radio-card {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--coas-border);
  border-radius: var(--coas-radius);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: border-color 0.15s, background 0.15s;
}
.coasmedas-aux-radio-card input[type="radio"] {
  accent-color: var(--coas-primary);
}
.coasmedas-aux-radio-card:has(input:checked) {
  border-color: var(--coas-primary);
  background: var(--coas-primary-light);
}
.coasmedas-aux-radio-card .coasmedas-aux-radio-monto {
  font-weight: 700;
  color: var(--coas-primary);
  font-size: 0.8rem;
  display: block;
}

/* ── Hijos dinámicos ── */
.coasmedas-aux-hijos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.coasmedas-aux-hijo-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.coasmedas-aux-hijo-row input[type="number"] {
  width: 80px;
  padding: 5px 8px;
  border: 1px solid var(--coas-border);
  border-radius: 6px;
  font-size: 0.875rem;
}
.coasmedas-aux-hijo-row label {
  font-size: 0.85rem;
  color: var(--coas-text-muted);
}
.coasmedas-aux-hijo-remove {
  background: none;
  border: none;
  color: var(--coas-error-text);
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}
.coasmedas-aux-add-hijo {
  background: none;
  border: 1px dashed var(--coas-primary);
  color: var(--coas-primary);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  width: fit-content;
  transition: background 0.15s;
}
.coasmedas-aux-add-hijo:hover {
  background: var(--coas-primary-light);
}

/* ── Subtotal en tiempo real ── */
.coasmedas-aux-subtotal-bar {
  background: var(--coas-primary-light);
  border: 1px solid var(--coas-border);
  border-radius: var(--coas-radius);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 0.9rem;
}
.coasmedas-aux-subtotal-bar strong {
  font-size: 1rem;
  color: var(--coas-primary);
}

/* ── Card total destacado ── */
.coasmedas-aux-total-card {
  background: #14532d;
  color: #ffffff;
  border-radius: var(--coas-radius);
  padding: 24px;
  text-align: center;
  margin: 20px 0 16px;
}
.coasmedas-aux-total-card .coasmedas-aux-total-label {
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 8px;
}
.coasmedas-aux-total-card .coasmedas-aux-total-valor {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

/* ── Resultado: cards de beneficios activos ── */
.coasmedas-aux-result-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.coasmedas-aux-result-card {
  background: var(--coas-primary-light);
  border: 1px solid var(--coas-border);
  border-radius: var(--coas-radius);
  padding: 12px 14px;
}
.coasmedas-aux-result-card .nombre {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--coas-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.coasmedas-aux-result-card .condicion {
  font-size: 0.78rem;
  color: var(--coas-text-muted);
  margin-bottom: 6px;
}
.coasmedas-aux-result-card .monto {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--coas-primary);
}

/* ── Tabla educativo ── */
.coasmedas-aux-edu-wrap {
  overflow-x: auto;
  border-radius: var(--coas-radius);
  border: 1px solid var(--coas-border);
  margin-bottom: 16px;
}
.coasmedas-aux-edu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.845rem;
  min-width: 520px;
}
.coasmedas-aux-edu-table thead tr {
  background: var(--coas-primary);
  color: #fff;
}
.coasmedas-aux-edu-table th {
  padding: 9px 12px;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
.coasmedas-aux-edu-table th:first-child,
.coasmedas-aux-edu-table td:first-child {
  text-align: center;
}
.coasmedas-aux-edu-table td {
  padding: 7px 12px;
  text-align: right;
  border-bottom: 1px solid var(--coas-border);
}
.coasmedas-aux-edu-table tr:nth-child(even) td { background: var(--coas-row-odd); }
.coasmedas-aux-edu-table tr:nth-child(odd)  td { background: var(--coas-row-even); }
.coasmedas-aux-edu-table tfoot td {
  font-weight: 700;
  background: var(--coas-primary-light);
  padding: 8px 12px;
  text-align: right;
}

/* ── Tabla desglose total ── */
.coasmedas-aux-desglose-wrap {
  overflow-x: auto;
  border-radius: var(--coas-radius);
  border: 1px solid var(--coas-border);
  margin-bottom: 16px;
}
.coasmedas-aux-desglose-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.coasmedas-aux-desglose-table th {
  background: var(--coas-primary);
  color: #fff;
  padding: 9px 16px;
  text-align: left;
}
.coasmedas-aux-desglose-table th:last-child,
.coasmedas-aux-desglose-table td:last-child {
  text-align: right;
}
.coasmedas-aux-desglose-table td {
  padding: 8px 16px;
  border-bottom: 1px solid var(--coas-border);
}
.coasmedas-aux-desglose-table tr:nth-child(even) td { background: var(--coas-row-odd); }
.coasmedas-aux-desglose-table tr:nth-child(odd)  td { background: var(--coas-row-even); }
.coasmedas-aux-desglose-table tfoot td {
  font-weight: 700;
  background: var(--coas-primary-light);
  padding: 9px 16px;
}

/* ── Nota legal ── */
.coasmedas-aux-nota-legal {
  font-size: 0.78rem;
  color: var(--coas-text-muted);
  line-height: 1.5;
  border-top: 1px solid var(--coas-border);
  margin-top: 16px;
  padding-top: 12px;
}

/* ── Calamidad monto preview ── */
.coasmedas-aux-calamidad-preview {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--coas-primary);
  white-space: nowrap;
}

/* ── Animación ── */
@keyframes coasFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive auxilios ── */
@media (max-width: 600px) {
  .coasmedas-aux-row {
    flex-direction: column;
    gap: 6px;
  }
  .coasmedas-aux-radio-group {
    flex-direction: column;
  }
  .coasmedas-aux-total-card .coasmedas-aux-total-valor {
    font-size: 1.5rem;
  }
  .coasmedas-aux-result-cards {
    grid-template-columns: 1fr 1fr;
  }
}
@media (max-width: 380px) {
  .coasmedas-aux-result-cards {
    grid-template-columns: 1fr;
  }
}

/* ═══════════════════════════════════════════════════════
   COASMEDAS Simulador de Medicinas Prepagadas
   Prefijo: .coasmedas-mp-
   ═══════════════════════════════════════════════════════ */

/* ── Config row (paso 1) ── */
.coasmedas-mp-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px 16px;
  margin-bottom: 20px;
}

/* ── Alerta suave Colmedica ── */
.coasmedas-mp-info-alert {
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
  border-radius: var(--coas-radius);
  padding: 10px 14px;
  font-size: 0.875rem;
  margin-bottom: 14px;
  display: none;
}
.coasmedas-mp-info-alert.visible { display: block; }

/* ── Nota de plan especial ── */
.coasmedas-mp-plan-nota {
  font-size: 0.78rem;
  color: #7c3aed;
  font-weight: 600;
  margin-top: 4px;
  display: none;
}
.coasmedas-mp-plan-nota.visible { display: block; }

/* ── Tabla beneficiarios (paso 2) ── */
.coasmedas-mp-bene-wrap {
  overflow-x: auto;
  border-radius: var(--coas-radius);
  border: 1px solid var(--coas-border);
  margin-bottom: 12px;
}
.coasmedas-mp-bene-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  min-width: 420px;
}
.coasmedas-mp-bene-table thead tr {
  background: var(--coas-primary);
  color: #fff;
}
.coasmedas-mp-bene-table th {
  padding: 9px 10px;
  text-align: center;
  font-weight: 600;
  white-space: nowrap;
}
.coasmedas-mp-bene-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--coas-border);
  text-align: center;
  vertical-align: middle;
}
.coasmedas-mp-bene-table input[type="number"],
.coasmedas-mp-bene-table select {
  padding: 5px 7px;
  border: 1px solid var(--coas-border);
  border-radius: 5px;
  font-size: 0.85rem;
  width: 100%;
  box-sizing: border-box;
}
.coasmedas-mp-bene-table input[type="number"] { width: 70px; }
.coasmedas-mp-bene-table select { min-width: 130px; }
.coasmedas-mp-bene-remove {
  background: none;
  border: none;
  color: var(--coas-error-text);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 2px 5px;
  line-height: 1;
}
.coasmedas-mp-tarifa-preview {
  font-size: 0.75rem;
  color: var(--coas-primary);
  font-weight: 600;
  white-space: nowrap;
}
.coasmedas-mp-add-bene {
  background: none;
  border: 1px dashed var(--coas-primary);
  color: var(--coas-primary);
  border-radius: 6px;
  padding: 5px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background 0.15s;
}
.coasmedas-mp-add-bene:hover { background: var(--coas-primary-light); }

/* ── Tabla de resultados por beneficiario ── */
.coasmedas-mp-result-wrap {
  overflow-x: auto;
  border-radius: var(--coas-radius);
  border: 1px solid var(--coas-border);
  margin-bottom: 20px;
}
.coasmedas-mp-result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.835rem;
  min-width: 680px;
}
.coasmedas-mp-result-table thead tr {
  background: var(--coas-primary);
  color: #fff;
}
.coasmedas-mp-result-table th {
  padding: 9px 10px;
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
.coasmedas-mp-result-table th:first-child,
.coasmedas-mp-result-table td:first-child,
.coasmedas-mp-result-table th:nth-child(2),
.coasmedas-mp-result-table td:nth-child(2) {
  text-align: center;
}
.coasmedas-mp-result-table td {
  padding: 8px 10px;
  text-align: right;
  border-bottom: 1px solid var(--coas-border);
  white-space: nowrap;
}
.coasmedas-mp-result-table tr:nth-child(even) td { background: var(--coas-row-odd); }
.coasmedas-mp-result-table tr:nth-child(odd)  td { background: var(--coas-row-even); }
.coasmedas-mp-row-warn td { background: #fff3cd !important; }
.coasmedas-mp-col-ahorro { font-weight: 700; color: #16a34a; }
.coasmedas-mp-col-pct { font-size: 0.78rem; color: var(--coas-text-muted); }

/* ── Cards de ahorro ── */
.coasmedas-mp-saving-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.coasmedas-mp-saving-card {
  background: #14532d;
  color: #fff;
  border-radius: var(--coas-radius);
  padding: 18px 14px;
  text-align: center;
}
.coasmedas-mp-saving-card .mp-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.8;
  margin-bottom: 6px;
}
.coasmedas-mp-saving-card .mp-card-value {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.coasmedas-mp-saving-card .mp-card-note {
  font-size: 0.7rem;
  opacity: 0.75;
  margin-top: 4px;
  line-height: 1.3;
}

/* ── Cuadro de totales ── */
.coasmedas-mp-totales-wrap {
  overflow-x: auto;
  border-radius: var(--coas-radius);
  border: 1px solid var(--coas-border);
  margin-bottom: 20px;
}
.coasmedas-mp-totales-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.coasmedas-mp-totales-table th {
  background: var(--coas-primary);
  color: #fff;
  padding: 9px 16px;
  text-align: left;
}
.coasmedas-mp-totales-table th:last-child,
.coasmedas-mp-totales-table td:last-child { text-align: right; }
.coasmedas-mp-totales-table td {
  padding: 8px 16px;
  border-bottom: 1px solid var(--coas-border);
}
.coasmedas-mp-totales-table tr:nth-child(even) td { background: var(--coas-row-odd); }
.coasmedas-mp-totales-table tr:nth-child(odd)  td { background: var(--coas-row-even); }
.coasmedas-mp-totales-table tfoot td {
  font-weight: 700;
  background: var(--coas-primary-light);
  padding: 9px 16px;
}

/* ── Sección clínicas ── */
.coasmedas-mp-clinicas {
  background: var(--coas-primary-light);
  border: 1px solid var(--coas-border);
  border-radius: var(--coas-radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 0.875rem;
}
.coasmedas-mp-clinicas-title {
  font-weight: 700;
  color: var(--coas-primary);
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.coasmedas-mp-clinicas ul {
  margin: 0;
  padding-left: 18px;
  color: var(--coas-text);
  line-height: 1.7;
}

/* ── Responsive ── */
@media (max-width: 680px) {
  .coasmedas-mp-saving-cards {
    grid-template-columns: 1fr;
  }
  .coasmedas-mp-config-grid {
    grid-template-columns: 1fr;
  }
  .coasmedas-mp-saving-card .mp-card-value {
    font-size: 1.15rem;
  }
}

/* ═══════════════════════════════════════════════════════
   COASMEDAS Menú Flotante Radial
   Prefijo: .coas-fab-
   ═══════════════════════════════════════════════════════ */

/* ── Contenedor fijo ── */
.coas-fab-container {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 99998;
  /* Mismo ancho/alto que el botón central; satélites se posicionan en absolute */
  width: 60px;
  height: 60px;
}

/* ── Botón central ── */
.coas-fab-central {
  position: relative;
  z-index: 2;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--coas-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 91, 170, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, transform 0.2s;
}
.coas-fab-central:hover,
.coas-fab-central:focus-visible {
  background: var(--coas-primary-dark);
  transform: scale(1.06);
  outline: none;
}

/* ── Iconos + / × ── */
.coas-fab-icon-open,
.coas-fab-icon-close {
  position: absolute;
  font-size: 1.85rem;
  font-weight: 300;
  line-height: 1;
  user-select: none;
  transition: opacity 0.2s ease, transform 0.3s ease;
}
.coas-fab-icon-open  { opacity: 1; transform: rotate(0deg); }
.coas-fab-icon-close { opacity: 0; transform: rotate(-45deg); }

.coas-fab-container.coas-fab-abierto .coas-fab-icon-open  { opacity: 0; transform: rotate(45deg); }
.coas-fab-container.coas-fab-abierto .coas-fab-icon-close { opacity: 1; transform: rotate(0deg); }

/* ── Satélites (estado colapsado) ── */
.coas-fab-sat {
  position: absolute;
  z-index: 1;
  /* Anclados al borde inferior-izquierdo del contenedor (sobre el central) */
  bottom: 10px;
  left: 0;
  height: 40px;
  padding: 0 18px;
  border-radius: 24px;
  white-space: nowrap;
  background: var(--fab-color, var(--coas-primary));
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Colapsados: invisible y apilados sobre el central */
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
  transition:
    transform  0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity    0.2s  ease;
  transition-delay: 0ms;
}
.coas-fab-sat:hover        { filter: brightness(1.12); }
.coas-fab-sat:focus-visible { outline: 3px solid var(--coas-accent); outline-offset: 2px; }

/* ── Satélites (estado abierto): translate via CSS custom props ── */
.coas-fab-container.coas-fab-abierto .coas-fab-sat {
  opacity: 1;
  transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(1);
  pointer-events: auto;
  transition-delay: var(--delay, 0ms);
}

/* ── Pulso inicial: 3 ciclos de 1 s ── */
@keyframes coas-fab-pulso {
  0%   { box-shadow: 0 4px 14px rgba(0, 91, 170, 0.45), 0 0 0 0    rgba(0, 91, 170, 0.35); }
  70%  { box-shadow: 0 4px 14px rgba(0, 91, 170, 0.45), 0 0 0 16px rgba(0, 91, 170, 0);    }
  100% { box-shadow: 0 4px 14px rgba(0, 91, 170, 0.45), 0 0 0 0    rgba(0, 91, 170, 0);    }
}
.coas-fab-central.coas-fab-pulsando {
  animation: coas-fab-pulso 1s ease-out 3;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .coas-fab-container { bottom: 16px; left: 16px; }
}
