/* ===== Módulo de Cobranza ===== */
#vista-cobranza .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
#vista-cobranza .muted { color: var(--gris-texto); }
#vista-cobranza code { background: #eef2f7; padding: 1px 5px; border-radius: 4px; font-size: 12px; }

.cb-banner { border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cb-banner.prueba { background: #fff8e1; color: #8a6100; border: 1px solid #f3dc9a; }
.cb-banner.real { background: #fdecea; color: #a52a1e; border: 1px solid #f5c6cb; }
.cb-banner b { font-weight: 700; }

.cb-subnav { display: flex; gap: 8px; margin-bottom: 16px; }
.cb-subnav button { padding: 8px 16px; border: 1px solid var(--gris-borde); background: white; border-radius: 20px; font-size: 13.5px; cursor: pointer; color: var(--gris-texto); font-weight: 600; }
.cb-subnav button.activo { background: var(--azul-medio); border-color: var(--azul-medio); color: white; }

.cb-kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 16px; }
.cb-kpi { background: white; border: 1px solid var(--gris-borde); border-left-width: 4px; border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: box-shadow .15s; }
.cb-kpi:hover { box-shadow: 0 2px 10px rgba(28,43,60,.08); }
.cb-kpi.activo { box-shadow: 0 0 0 2px var(--acento); }
.cb-kpi .n { font-size: 24px; font-weight: 700; line-height: 1.1; }
.cb-kpi .l { font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--gris-texto); margin-top: 2px; }
.cb-kpi .m { font-size: 12px; color: var(--gris-texto); margin-top: 4px; min-height: 15px; }
.cb-kpi.k-bad { border-left-color: #d6455d; } .cb-kpi.k-warn { border-left-color: #e0a526; } .cb-kpi.k-ok { border-left-color: #2e8b57; }
.cb-kpi.k-violet { border-left-color: #8b6fe0; } .cb-kpi.k-info { border-left-color: #9fb3c8; } .cb-kpi.k-contact { border-left-color: #3d7ab8; }

.cb-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cb-toolbar input[type=text] { flex: 1; min-width: 220px; padding: 9px 12px; border: 1px solid var(--gris-borde); border-radius: 7px; font-size: 14px; }
.cb-btn { padding: 9px 16px; border: 1px solid var(--gris-borde); background: white; border-radius: 7px; font-size: 13.5px; cursor: pointer; color: var(--azul-oscuro); font-weight: 600; }
.cb-btn:hover { background: #f5f7fa; }
.cb-btn.primario { background: var(--azul-medio); color: white; border-color: var(--azul-medio); }
.cb-btn.primario:hover { background: var(--acento); }
.cb-btn.verde { background: var(--verde); color: white; border-color: var(--verde); }
.cb-btn.verde:hover { background: #256b45; }
.cb-btn.peligro { color: var(--rojo); border-color: #f0c4be; }
.cb-btn.chico { padding: 5px 10px; font-size: 12.5px; }
.cb-btn:disabled { opacity: .5; cursor: not-allowed; }

.cb-tabla-wrap { overflow-x: auto; }
#vista-cobranza table.cb-tabla td, #vista-cobranza table.cb-tabla th { padding: 9px 10px; }
.cb-fila { cursor: pointer; }
.cb-fila:hover td { background: #f8fafc; }
.cb-nombre { font-weight: 600; }
.cb-sub { font-size: 12px; color: var(--gris-texto); }
.cb-tag-pend { display: inline-block; background: #fdecea; color: #a52a1e; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 8px; margin-left: 6px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.pill.ok { background: #e4f6ec; color: #1e7b46; } .pill.warn { background: #fdf1dd; color: #8a5a00; }
.pill.bad { background: #fde9ec; color: #b0283f; } .pill.info { background: #eef2f7; color: #5a6b7d; }
.pill.violet { background: #f0ebfd; color: #6a4fc4; } .pill.azul { background: #e6f0fa; color: #2c5f93; }

/* Cajón lateral */
.cb-overlay { position: fixed; inset: 0; background: rgba(20,30,45,.35); display: none; z-index: 50; justify-content: flex-end; }
.cb-overlay.abierto { display: flex; }
.cb-overlay.cb-center { justify-content: center; align-items: center; z-index: 60; }
.cb-drawer { width: min(760px, 96vw); background: #f5f7fa; height: 100%; overflow-y: auto; box-shadow: -8px 0 30px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.cb-drawer-head { background: var(--azul-oscuro); color: white; padding: 18px 22px; position: sticky; top: 0; z-index: 2; }
.cb-drawer-head .t { font-size: 17px; font-weight: 700; padding-right: 30px; }
.cb-drawer-head .s { font-size: 12.5px; color: #9fb3c8; margin-top: 3px; }
.cb-drawer-head .x { position: absolute; right: 16px; top: 14px; background: transparent; border: none; color: white; font-size: 24px; cursor: pointer; line-height: 1; }
.cb-tabs { display: flex; gap: 2px; background: white; border-bottom: 1px solid var(--gris-borde); padding: 0 14px; position: sticky; top: 76px; z-index: 1; }
.cb-tabs button { padding: 12px 14px; border: none; background: transparent; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--gris-texto); border-bottom: 3px solid transparent; }
.cb-tabs button.activo { color: var(--azul-medio); border-bottom-color: var(--azul-medio); }
.cb-drawer-body { padding: 20px 22px 40px; }
.cb-card { background: white; border: 1px solid var(--gris-borde); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.cb-card h3 { margin: 0 0 12px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--gris-texto); }

.cb-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cb-grid.tres { grid-template-columns: repeat(3, 1fr); }
.cb-campo label { display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; color: var(--gris-texto); font-weight: 600; margin-bottom: 5px; }
.cb-campo input, .cb-campo select, .cb-campo textarea, .cb-celda-input { width: 100%; padding: 8px 10px; border: 1px solid var(--gris-borde); border-radius: 6px; font-size: 13.5px; font-family: inherit; }
.cb-campo textarea { resize: vertical; min-height: 70px; }
.cb-campo input:focus, .cb-campo select:focus, .cb-campo textarea:focus, .cb-celda-input:focus { outline: none; border-color: var(--acento); }
.cb-check { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.cb-resumen-estado { font-size: 13.5px; line-height: 1.7; }

.cb-tabla-mini { width: 100%; border-collapse: collapse; font-size: 13px; }
.cb-tabla-mini th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--gris-texto); padding: 6px 6px; border-bottom: 1px solid var(--gris-borde); }
.cb-tabla-mini td { padding: 6px 6px; border-bottom: 1px solid #eef1f5; vertical-align: middle; }
.cb-celda-input { padding: 6px 8px; font-size: 13px; }
.cb-acciones { white-space: nowrap; display: flex; gap: 5px; align-items: center; }
a.cb-wa { display: inline-block; padding: 5px 9px; border-radius: 6px; background: #25d366; color: white; font-size: 12px; font-weight: 700; text-decoration: none; }
a.cb-wa.off { background: #c9d2db; pointer-events: none; }

.cb-previa { background: #fafbfc; border: 1px dashed var(--gris-borde); border-radius: 8px; padding: 12px; }
.cb-linea { padding: 8px 0; border-bottom: 1px solid #eef1f5; font-size: 13px; }
.cb-linea:last-child { border-bottom: none; }

/* Modal */
.cb-modal { background: white; border-radius: 12px; padding: 24px; width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.cb-modal h3 { margin: 0 0 12px; font-size: 16px; }
.cb-progreso { height: 8px; background: #e6ebf1; border-radius: 4px; overflow: hidden; margin: 12px 0; }
.cb-progreso > div { height: 100%; background: var(--verde); width: 0; transition: width .3s; }
.cb-lista-sel { max-height: 220px; overflow-y: auto; border: 1px solid var(--gris-borde); border-radius: 7px; }
.cb-lista-sel div { padding: 8px 12px; border-bottom: 1px solid #eef1f5; cursor: pointer; font-size: 13.5px; }
.cb-lista-sel div:hover { background: #f1f6fb; }

.cb-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--azul-oscuro); color: white; padding: 11px 20px; border-radius: 8px; font-size: 13.5px; z-index: 100; display: none; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.cb-toast.error { background: #a52a1e; }
.cb-toast.visible { display: block; }

@media (max-width: 1000px) { .cb-kpis { grid-template-columns: repeat(3, 1fr); } }

.cb-modal.ancho { width: min(860px, 96vw); }
.cb-modal details summary { cursor: pointer; font-size: 13px; color: var(--azul-medio); font-weight: 600; }
.cb-reporte ul { margin: 6px 0 0 18px; padding: 0; font-size: 13.5px; line-height: 1.7; }
.cb-reporte h4 { margin: 14px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--gris-texto); }
