/* ============================================================
   CuentasPorPagar.css — Cuentas por Pagar (CxP)
   ============================================================ */

#pageCuentasPorPagar .cxp-badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 10px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
}
#pageCuentasPorPagar .cxp-b-azul { background: #dbeafe; color: #1e40af; }
#pageCuentasPorPagar .cxp-b-ambar { background: #fef3c7; color: #92400e; }
#pageCuentasPorPagar .cxp-b-rojo { background: #fee2e2; color: #b91c1c; }
#pageCuentasPorPagar .cxp-b-verde { background: #dcfce7; color: #15803d; }
#pageCuentasPorPagar .cxp-b-gris { background: #e5e7eb; color: #4b5563; }

#pageCuentasPorPagar .cxp-dias {
    display: inline-block;
    min-width: 22px;
    padding: 1px 6px;
    border-radius: 10px;
    background: #fef2f2;
    color: #b91c1c;
    font-weight: 700;
    font-size: 0.66rem;
}

/* ---------- Modal de detalle ---------- */
.cxp-det { padding: 2px; }
.cxp-det-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 14px;
}
.cxp-det-prov { font-size: 1rem; font-weight: 700; color: #1A4480; }
.cxp-det-ruc { font-size: 0.72rem; color: #64748b; margin-top: 2px; }

.cxp-det-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 18px;
    margin-bottom: 16px;
}
.cxp-det-item { display: flex; flex-direction: column; }
.cxp-det-item span {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    font-weight: 600;
}
.cxp-det-item strong { font-size: 0.82rem; color: #1e293b; font-weight: 600; }

.cxp-det-montos {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 18px;
}
.cxp-det-monto {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 10px 14px;
}
.cxp-det-monto span {
    font-size: 0.66rem;
    text-transform: uppercase;
    color: #64748b;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.cxp-det-monto strong { font-size: 0.95rem; color: #1e293b; }
.cxp-det-saldo { background: #fef2f2; border-color: #fecaca; }
.cxp-det-saldo strong { color: #b91c1c; }

.cxp-verde { color: #15803d; }
.cxp-rojo { color: #b91c1c; }

.cxp-det-sub {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #1A4480;
    margin-bottom: 8px;
}

.cxp-det-tabla-wrap {
    border: 1px solid var(--gris-200);
    border-radius: 8px;
    overflow: auto;
    max-height: 300px;
}
.cxp-det-tabla { width: 100%; border-collapse: collapse; font-size: 0.7rem; }
.cxp-det-tabla th {
    position: sticky !important;
    top: 0;
    z-index: 2;
    background: var(--azul-500);
    color: #fff;
    padding: 7px 8px;
    text-align: left;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border-bottom: 2px solid var(--azul-700);
}
.cxp-det-tabla td {
    padding: 5px 8px;
    color: #334155;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}
.cxp-det-tabla tbody tr:hover { background: rgba(37, 99, 160, 0.08); }

.cxp-ag-tabla tfoot td {
    font-weight: 700;
    color: #1A4480;
    background: #f1f5f9;
    border-top: 2px solid var(--azul-500);
}
.cxp-ag-prov { font-weight: 600; color: #1e293b; }
.cxp-ag-total { font-weight: 700; color: #1A4480; }

.cxp-det-vacio {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .cxp-det-grid { grid-template-columns: repeat(2, 1fr); }
    .cxp-det-montos { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .cxp-det-grid { grid-template-columns: 1fr; }
}
