/* Ficha de operaciones del contacto (/contactos/{id}/resumen) y panel en el formulario. */
.pops-filters .pops-quick, .pops-blocks { display: flex; flex-wrap: wrap; gap: .4rem .9rem; align-items: center; }
.pops-quick { gap: .4rem; }
.pops-check { display: inline-flex; align-items: center; gap: .35rem; font-size: .85rem; cursor: pointer; }

.pops-sheet { background: #fff; border: 1px solid var(--color-gray-200, #e4e4e7); border-radius: .75rem; padding: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; color: #18181b; }
.pops-hdr { display: flex; justify-content: space-between; gap: 1.5rem; padding-bottom: .9rem; border-bottom: 2px solid #27272a; }
.pops-company, .pops-doc { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.pops-company strong { font-size: 1.05rem; }
.pops-company small, .pops-doc small { color: #52525b; font-size: .78rem; }
.pops-logo { max-width: 70mm; object-fit: contain; object-position: left; margin-bottom: .3rem; }
.pops-doc { text-align: right; }
.pops-doc-type { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #52525b; }
.pops-doc strong { font-size: 1.15rem; }

.pops-party { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.pops-party dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem .9rem; margin: 0; font-size: .85rem; }
.pops-party dt { color: #71717a; }
.pops-party dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

.pops-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(10.5rem, 1fr)); gap: .6rem; }
.pops-kpi { border: 1px solid #e4e4e7; border-radius: .65rem; padding: .7rem .85rem; display: flex; flex-direction: column; gap: .2rem; background: #fafafa; }
.pops-kpi span { font-size: .75rem; color: #71717a; }
.pops-kpi strong { font-size: 1.2rem; font-variant-numeric: tabular-nums; }
.pops-kpi strong small { font-size: .75rem; font-weight: 500; color: #71717a; margin-left: .25rem; }
.pops-kpi.warn strong { color: #b45309; }
.pops-kpi.bad strong { color: #be123c; }
.pops-kpis.compact { grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); padding: 0 1rem; }
.pops-kpis.compact .pops-kpi strong { font-size: 1.05rem; }

.pops-block h2 { font-size: .95rem; font-weight: 600; margin: 0 0 .5rem; }
.pops-block h2 small { font-weight: 400; }
.pops-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.pops-table th { text-align: left; background: #f4f4f5; padding: .45rem .55rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: #52525b; white-space: nowrap; }
.pops-table td { padding: .38rem .55rem; border-bottom: 1px solid #f0f0f2; vertical-align: top; }
.pops-table tfoot td { background: #f4f4f5; font-weight: 600; border-bottom: 0; }
.pops-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pops-table .pops-ref { color: #52525b; max-width: 18rem; overflow-wrap: anywhere; }
.pops-table a { font-weight: 500; }
.pops-neg { color: #be123c; }

.pops-pill { display: inline-block; font-size: .7rem; font-weight: 600; border-radius: 999px; padding: .1rem .5rem; white-space: nowrap; background: #eff6ff; color: #1d4ed8; }
.pops-pill.ok { background: #f0fdf4; color: #15803d; }
.pops-pill.warn { background: #fffbeb; color: #b45309; }
.pops-pill.bad { background: #fff1f2; color: #be123c; }
.pops-pill.muted { background: #f4f4f5; color: #71717a; }

.pops-aging-bar { display: flex; height: .7rem; border-radius: 999px; overflow: hidden; background: #f4f4f5; margin: .25rem 0 .6rem; }
.pops-panel .pops-aging-bar { margin: .9rem 1rem .25rem; }
.pops-aging-bar span { display: block; height: 100%; }
.pops-aging-legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin: 0 1rem .4rem; font-size: .76rem; color: #52525b; }
.pops-aging-legend strong { font-variant-numeric: tabular-nums; color: inherit; }
html.dark .pops-aging-legend { color: #a1a1aa; }
.a0 { background: #22c55e; }
.a1 { background: #facc15; }
.a2 { background: #fb923c; }
.a3 { background: #f43f5e; }
.a4 { background: #9f1239; }
.pops-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 999px; margin-right: .3rem; vertical-align: middle; }
.pops-dot.inv, .pops-bar.inv { background: #6366f1; }
.pops-dot.col, .pops-bar.col { background: #10b981; }
.pops-bars-col { width: 28%; }
.pops-bar { display: block; height: .32rem; border-radius: 999px; margin: .12rem 0; min-width: 1px; }
.pops-legend { font-weight: 400; font-size: .72rem; color: #52525b; white-space: nowrap; }
.pops-legend .pops-dot:nth-of-type(2) { margin-left: .6rem; }

.pops-foot { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px solid #e4e4e7; padding-top: .6rem; font-size: .72rem; color: #71717a; }

.pops-panel-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
.pops-list { list-style: none; margin: .5rem 1rem 1rem; padding: 0; }
.pops-list li { display: flex; align-items: center; gap: .6rem; padding: .4rem 0; border-bottom: 1px solid #f0f0f2; font-size: .85rem; }
.pops-list li:last-child { border-bottom: 0; }
.pops-list-amount { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }

@media (max-width: 720px) {
    .pops-hdr, .pops-party { grid-template-columns: 1fr; flex-direction: column; }
    .pops-doc { text-align: left; }
    .pops-sheet { padding: 1rem; }
    .pops-bars-col { display: none; }
}

html.dark .pops-sheet { background: #18181b; border-color: #27272a; color: #f4f4f5; }
html.dark .pops-hdr { border-color: #52525b; }
html.dark .pops-kpi { background: #1f1f23; border-color: #27272a; }
html.dark .pops-table th, html.dark .pops-table tfoot td { background: #27272a; color: #d4d4d8; }
html.dark .pops-table td, html.dark .pops-list li { border-color: #27272a; }
html.dark .pops-company small, html.dark .pops-doc small, html.dark .pops-doc-type, html.dark .pops-table .pops-ref, html.dark .pops-legend { color: #a1a1aa; }
html.dark .pops-aging-bar { background: #27272a; }
html.dark .pops-pill { background: rgba(59, 130, 246, .16); color: #93c5fd; }
html.dark .pops-pill.ok { background: rgba(34, 197, 94, .16); color: #86efac; }
html.dark .pops-pill.warn { background: rgba(245, 158, 11, .16); color: #fcd34d; }
html.dark .pops-pill.bad { background: rgba(244, 63, 94, .16); color: #fda4af; }
html.dark .pops-pill.muted { background: #27272a; color: #a1a1aa; }
html.dark .pops-kpi.warn strong { color: #fbbf24; }
html.dark .pops-kpi.bad strong, html.dark .pops-neg { color: #fb7185; }
html.dark .pops-foot { border-color: #27272a; }

@media print {
    @page { size: A4; margin: 10mm; }
    .pops-sheet { border: 0 !important; padding: 0 !important; gap: 4mm; background: #fff !important; color: #18181b !important; font-size: 9pt; }
    .pops-kpis { grid-template-columns: repeat(4, 1fr); gap: 2mm; }
    .pops-kpi { padding: 2mm 3mm; background: #fff !important; border-color: #d4d4d8 !important; }
    .pops-kpi strong { font-size: 11pt; color: #18181b !important; }
    .pops-kpi.warn strong { color: #b45309 !important; }
    .pops-kpi.bad strong { color: #be123c !important; }
    .pops-table { font-size: 8pt; }
    .pops-table th, .pops-table tfoot td { background: #f4f4f5 !important; color: #3f3f46 !important; }
    .pops-table td { border-color: #e4e4e7 !important; }
    .pops-table thead { display: table-header-group; }
    .pops-table tr { break-inside: avoid; }
    .pops-block h2 { break-after: avoid; }
    .pops-table a { color: inherit !important; text-decoration: none; }
    .pops-sheet, .pops-sheet * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
