/* ═══════════════════════════════════════════════════════
   Operación diaria: préstamos, cobros, cobranza y recibos
   Complementa app.css (mobile-first, áreas táctiles ≥ 44 px)
   ═══════════════════════════════════════════════════════ */

.min-w-0 { min-width: 0; }

/* ── Navegación y enlaces ─────────────────────────────── */
.enlace-volver {
    display: inline-flex; align-items: center; min-height: var(--toque);
    font-size: .88rem; text-decoration: none;
}
.enlace-tel {
    display: inline-flex; align-items: center; min-height: 36px;
    font-weight: 600; font-size: .9rem; text-decoration: none;
}
a.item-movil { color: inherit; text-decoration: none; -webkit-tap-highlight-color: transparent; }
a.item-movil:active { background: #F1F5F9; }
a.item-movil:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }

.btn-accion-principal { font-weight: 700; min-height: 52px; }

/* ── Badges y estados ─────────────────────────────────── */
.badge-hoy { background: #FEF3C7; color: #92400E; }
.cuota-numero {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: #F1F5F9; color: #475569; font-weight: 700; font-size: .8rem;
}
.cuota-numero.pagada  { background: #D1FAE5; color: #065F46; }
.cuota-numero.vencida { background: #FEE2E2; color: #991B1B; }

/* ── Cifras del detalle ───────────────────────────────── */
.cifra-label { font-size: .74rem; color: var(--text-muted); font-weight: 500; }
.cifra-valor { font-size: 1.1rem; font-weight: 700; color: #1E293B; line-height: 1.25; overflow-wrap: anywhere; }
.cifra-sub   { font-size: .76rem; color: var(--text-muted); }
.detalle-condiciones { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }

/* ── Formulario de nuevo préstamo ─────────────────────── */
.form-seccion {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 14px; font-size: 1rem; font-weight: 700; color: #1E293B;
}
.form-seccion-num {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary); color: #fff; font-size: .8rem;
}
.form-control.monto-grande { font-size: 1.5rem !important; font-weight: 700; }

.cliente-elegido {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 12px;
    border: 1px solid #BFDBFE; background: #EFF6FF;
}
.lista-clientes {
    border: 1px solid var(--border); border-radius: 12px;
    max-height: 300px; overflow-y: auto; overscroll-behavior: contain;
}

.opcion-bloqueada {
    display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
    padding: 10px 12px; border: 1px dashed #CBD5E1; border-radius: 10px;
    background: #F8FAFC; color: #475569; font-size: .84rem;
}
.interruptor-grande { display: flex; align-items: center; gap: 10px; min-height: var(--toque); padding-left: 0; margin: 0; }
.interruptor-grande .form-check-input { float: none; margin: 0; width: 2.6em; height: 1.4em; flex-shrink: 0; }
.interruptor-grande .form-check-label { font-weight: 600; font-size: .9rem; }

/* Vista previa del cronograma */
@media (min-width: 992px) {
    .preview-sticky { position: sticky; top: 76px; }
}
.resumen-cuota {
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    border-radius: 12px; padding: 14px 16px; margin-bottom: 10px;
}
.resumen-cuota-valor { font-size: 1.6rem; font-weight: 800; color: #1D4ED8; line-height: 1.15; overflow-wrap: anywhere; }
.resumen-fila {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 7px 0; border-bottom: 1px solid #F1F5F9; font-size: .88rem;
}
.resumen-fila > span:first-child { color: var(--text-muted); }
.resumen-fila > span:last-child  { font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.resumen-fila.resumen-total { font-size: .98rem; }
.resumen-fila.resumen-total > span { color: #1E293B; font-weight: 800; }
.cronograma-preview {
    max-height: 360px; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 10px;
}
.cronograma-preview thead th { position: sticky; top: 0; z-index: 1; }

/* ── WhatsApp ─────────────────────────────────────────── */
.btn-whatsapp {
    --bs-btn-color: #fff; --bs-btn-bg: #25D366; --bs-btn-border-color: #25D366;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #1EBE5A; --bs-btn-hover-border-color: #1EBE5A;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #1A9E4B; --bs-btn-active-border-color: #1A9E4B;
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #25D366; --bs-btn-disabled-border-color: #25D366;
    font-weight: 600;
}
.btn-outline-whatsapp {
    --bs-btn-color: #128C4A; --bs-btn-border-color: #25D366;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #25D366; --bs-btn-hover-border-color: #25D366;
    --bs-btn-active-color: #fff; --bs-btn-active-bg: #1EBE5A; --bs-btn-active-border-color: #1EBE5A;
    font-weight: 600;
}

/* ── Dashboard: para cobrar hoy ───────────────────────── */
.tarjeta-hoy {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px;
    padding: 18px 20px; border-left: 4px solid var(--primary);
}
.tarjeta-hoy-cuerpo { display: flex; align-items: center; gap: 16px; flex: 1 1 260px; min-width: 0; }
.tarjeta-hoy-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.tarjeta-hoy-acciones .btn { min-height: var(--toque); display: inline-flex; align-items: center; justify-content: center; font-weight: 600; }
@media (max-width: 575.98px) {
    .tarjeta-hoy { padding: 16px; }
    .tarjeta-hoy-acciones { width: 100%; }
    .tarjeta-hoy-acciones .btn { flex: 1 1 0; }
}

/* ── Recibo ───────────────────────────────────────────── */
.recibo {
    position: relative; max-width: 340px; margin: 0 auto; padding: 18px 16px;
    background: #fff; color: #111; border-radius: 6px; box-shadow: 0 1px 4px rgba(0,0,0,.12);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;
    font-size: .82rem; line-height: 1.45;
}
.recibo-negocio { text-align: center; font-size: 1.2em; font-weight: 700; text-transform: uppercase; overflow-wrap: anywhere; }
.recibo-centro  { text-align: center; font-size: .92em; color: #333; overflow-wrap: anywhere; }
.recibo-titulo  { margin: 10px 0 8px; text-align: center; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.recibo-fila { display: flex; justify-content: space-between; gap: 12px; padding: 1px 0; }
.recibo-fila > span:first-child { flex-shrink: 0; color: #444; }
.recibo-fila > span:last-child  { min-width: 0; text-align: right; overflow-wrap: anywhere; }
.recibo-fila.recibo-total { font-size: 1.25em; font-weight: 700; }
.recibo-fila.recibo-total > span:first-child { color: inherit; }
.recibo-fila.recibo-destacado { font-weight: 700; }
.recibo-sep { margin: 8px 0; border-top: 1px dashed #999; }
.recibo-pagado { margin-top: 10px; padding: 4px; border: 1px solid #111; text-align: center; font-weight: 700; }
.recibo-gracias { margin-top: 12px; text-align: center; font-size: .95em; }
.recibo-anulado {
    margin-bottom: 8px; padding: 2px; border: 2px solid #B91C1C; color: #B91C1C;
    text-align: center; font-weight: 800; letter-spacing: 2px;
}

/* Impresión: BimoCartera.imprimir copia el recibo a #zona-impresion (hijo de <body>)
   y se oculta todo lo demás. Angosto para impresoras térmicas de 58/80 mm. */
#zona-impresion { display: none; }
@page recibo { margin: 3mm; }
@media print {
    body.imprimiendo-recibo { background: #fff !important; overflow: visible !important; }
    body.imprimiendo-recibo > *:not(#zona-impresion) { display: none !important; }
    body.imprimiendo-recibo #zona-impresion { display: block !important; page: recibo; }
    #zona-impresion .recibo {
        width: 100%; max-width: 80mm; margin: 0; padding: 0;
        border-radius: 0; box-shadow: none; font-size: 11px; color: #000;
    }
    /* 58 mm: si el valor no cabe junto a la etiqueta, baja a la línea siguiente alineado a la derecha */
    #zona-impresion .recibo-fila { flex-wrap: wrap; gap: 0 8px; }
    #zona-impresion .recibo-fila > span:last-child { margin-left: auto; }
    #zona-impresion .recibo-fila > span:first-child,
    #zona-impresion .recibo-centro { color: #000; }
    #zona-impresion .recibo-sep { border-top-color: #000; }
}
