/* Vouchers / gift cards (/vouchers). Hoja global (los .razor.css no se cargan); prefijo vc-.
   La base (cabecera, tarjeta, pestañas, tabla, estados, período, paginado) es la de
   presupuestos-lista.css (pl-) y compras-lista.css (cm-); los campos de los modales, los de
   presupuesto-form.css (pf-). */
.vc-pagina { --vc-verde: #15803d; --vc-rojo: #b91c1c; }

/* Resumen */
.vc-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1.25rem; }
.vc-kpi { padding: .9rem 1.1rem; background: #fff; border: 1px solid var(--pl-borde); border-radius: 14px; min-width: 0; }
.vc-kpi span { display: block; color: var(--pl-atenuado); font-size: .82rem; }
.vc-kpi strong { display: block; margin-top: .15rem; font-size: 1.35rem; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-kpi small { display: block; color: var(--pl-atenuado); font-size: .78rem; }
.vc-kpi-verde strong { color: var(--vc-verde); }
.vc-kpi-alerta strong { color: var(--pl-naranja); }

/* Buscador con el atajo F3 */
.vc-buscar input { padding-right: 3.2rem; }
.vc-kbd {
    position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
    padding: .1rem .4rem; border: 1px solid var(--pl-borde); border-radius: 6px; background: #f6f7f9;
    color: var(--pl-atenuado); font-family: inherit; font-size: .72rem; font-weight: 600; box-shadow: none; pointer-events: none;
}
.vc-buscar input:focus ~ .vc-kbd { display: none; }
.vc-periodos-rotulo { align-self: center; color: var(--pl-atenuado); font-size: .85rem; white-space: nowrap; }

/* Tabla */
.vc-tabla { min-width: 920px; }
.vc-fila { cursor: pointer; }
.vc-fila:focus-visible { outline: 2px solid var(--pl-azul); outline-offset: -2px; }
.vc-col-numero { width: 150px; }
.vc-numero { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.vc-col-fecha { width: 110px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vc-vencido { color: var(--vc-rojo); font-weight: 600; }
.vc-col-quien { max-width: 280px; }
.vc-col-quien span, .vc-col-quien small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vc-al-portador { color: var(--pl-atenuado); }
.vc-col-importe { width: 130px; text-align: right !important; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vc-col-saldo small { white-space: nowrap; font-weight: 400; }
.vc-col-estado { width: 120px; }
.vc-col-acc { width: 88px; cursor: default; }
.vc-acciones { display: flex; align-items: center; justify-content: flex-end; gap: .15rem; }
.vc-acciones a.pl-mas { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.vc-saldo-cero { color: var(--pl-atenuado); font-weight: 500 !important; }
.vc-cargando { opacity: .55; transition: opacity .15s; }

/* Estados (punto de color de pl-estado) */
.vc-pagina .pl-estado-aprobado { color: var(--vc-verde); }
.vc-estado-parcial::before { background: #2563eb !important; }
.vc-estado-vencido { color: var(--vc-rojo); }
.vc-estado-vencido::before { background: #dc2626 !important; }

/* Modales */
.vc-modal .modal-content { border-radius: 16px; }
.vc-modal .modal-header, .vc-modal .modal-footer { padding: 1rem 1.25rem; }
.vc-modal .modal-title { font-weight: 600; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.vc-modal .modal-footer { gap: .5rem; }
.vc-modal .modal-footer > * { margin: 0; }
.vc-modal .modal-footer a.pl-btn { text-decoration: none; }
.vc-modal .pf-campo > small { color: var(--pf-atenuado); font-size: .8rem; }
.vc-modal .pf-campo > input:disabled { background: #f6f7f9; color: var(--pf-atenuado); }
.vc-grilla-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.vc-grilla-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vc-moneda { position: relative; }
.vc-moneda > i { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--pf-atenuado); font-style: normal; }
.vc-moneda > input {
    width: 100%; height: 44px; padding: 0 .85rem 0 1.75rem; border: 1px solid var(--pf-borde); border-radius: 10px;
    font-size: 1.05rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums;
}
.vc-atajos { display: flex; gap: .3rem; flex-wrap: wrap; }
.vc-atajo { border: 1px solid var(--pf-borde); border-radius: 999px; background: #fff; padding: .1rem .6rem; color: var(--pf-atenuado); font-size: .78rem; cursor: pointer; }
.vc-atajo:hover { border-color: var(--pf-azul); color: var(--pf-azul); }
.vc-sugerencias {
    position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 20; max-height: 220px; overflow: auto;
    background: #fff; border: 1px solid var(--pf-borde); border-radius: 10px; box-shadow: 0 8px 24px rgba(16, 24, 40, .12);
}
.vc-sugerencias button { display: block; width: 100%; padding: .5rem .85rem; border: 0; background: none; text-align: left; font-size: .92rem; }
.vc-sugerencias button:hover { background: #f1f3f5; }
.vc-cliente-elegido {
    display: flex; align-items: center; justify-content: space-between; gap: .5rem; height: 44px; padding: 0 .4rem 0 .85rem;
    border: 1px solid var(--pf-azul); border-radius: 10px; background: var(--pf-azul-claro);
}
.vc-cliente-elegido strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

/* Cobro de la emisión */
.vc-cobro { margin-top: 1.1rem; padding: 1rem; border: 1px solid var(--pf-borde); border-radius: 12px; background: #fafbfc; }
.vc-cobro-titulo { display: block; margin-bottom: .5rem; font-size: .88rem; }
.vc-segmentos { display: flex; gap: .2rem; padding: .25rem; border-radius: 12px; background: #eceef1; }
.vc-segmento {
    flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 38px; padding: .3rem .7rem;
    border: 0; border-radius: 9px; background: transparent; color: var(--pf-atenuado); font-size: .9rem; text-align: center; cursor: pointer;
}
.vc-segmento:hover:not(.activo) { color: var(--pf-texto); }
.vc-segmento.activo { background: #fff; color: var(--pf-texto); font-weight: 600; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.vc-cobro-medio { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: .75rem; align-items: center; margin-top: .85rem; }
.vc-cobro-medio .form-select { height: 44px; border-radius: 10px; border-color: var(--pf-borde); }
.vc-nota { color: var(--pf-atenuado); font-size: .85rem; }
.vc-nota strong { color: var(--pf-texto); }
.vc-total { margin-right: auto; color: var(--pf-atenuado); font-size: .9rem; }
.vc-total strong { color: var(--pf-texto); font-size: 1.1rem; font-variant-numeric: tabular-nums; }

/* Detalle */
.vc-datos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1rem; }
.vc-dato { padding: .65rem .8rem; border: 1px solid var(--pf-borde); border-radius: 12px; min-width: 0; }
.vc-dato span { display: block; color: var(--pf-atenuado); font-size: .78rem; }
.vc-dato strong { display: block; font-size: 1.05rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vc-dato-saldo strong { color: var(--vc-verde); }
.vc-ficha { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: .35rem 1rem; margin: 0 0 1.1rem; font-size: .9rem; }
.vc-ficha dt { color: var(--pf-atenuado); font-weight: 400; }
.vc-ficha dd { margin: 0; overflow-wrap: anywhere; }
.vc-anulado { padding: .6rem .8rem; margin-bottom: 1rem; border-radius: 10px; background: #fef2f2; color: var(--vc-rojo); font-size: .88rem; }
.vc-usos-titulo { margin: 0 0 .5rem; font-size: .95rem; font-weight: 600; }
.vc-usos-titulo span { color: var(--pf-atenuado); font-weight: 400; }
.vc-usos { border: 1px solid var(--pf-borde); border-radius: 12px; overflow: hidden; }
.vc-uso { display: grid; grid-template-columns: 130px minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: baseline; padding: .6rem .85rem; border-bottom: 1px solid #f0f1f3; font-size: .9rem; }
.vc-uso:last-child { border-bottom: 0; }
.vc-uso-fecha { color: var(--pf-atenuado); font-variant-numeric: tabular-nums; white-space: nowrap; }
.vc-uso-importe { font-weight: 600; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.vc-uso-revertido { color: var(--pf-atenuado); }
.vc-uso-revertido .vc-uso-importe { text-decoration: line-through; font-weight: 400; }
.vc-uso a { margin-left: .35rem; color: var(--pf-azul); font-size: .85rem; }
.vc-sin-usos { padding: 1rem; border: 1px dashed var(--pf-borde); border-radius: 12px; color: var(--pf-atenuado); text-align: center; font-size: .9rem; }
.vc-btn-peligro-contorno { border-color: #fecaca; color: var(--vc-rojo); margin-right: auto !important; }
.vc-btn-peligro-contorno:hover { background: #fef2f2 !important; }

@media (max-width: 991.98px) {
    .vc-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vc-periodos-rotulo { display: none; }
}

@media (max-width: 767.98px) {
    .vc-kpis { gap: .5rem; margin-bottom: 1rem; }
    .vc-kpi { padding: .7rem .85rem; border-radius: 12px; }
    .vc-kpi strong { font-size: 1.1rem; }
    .vc-kbd { display: none; }
    .vc-buscar input { padding-right: .8rem; }
    .vc-pagina .cm-periodos { flex: none; width: 100%; }
    .vc-pagina .cm-periodo { flex: 1; padding: .55rem .3rem; }

    /* La tabla pasa a tarjetas */
    .vc-tabla { min-width: 0; }
    .vc-tabla thead { display: none; }
    .vc-tabla tbody tr {
        display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; padding: .85rem 1rem;
        grid-template-areas: "numero saldo" "quien estado" "fechas acc";
        border-bottom: 1px solid #f0f1f3;
    }
    .vc-tabla td { display: block; padding: 0 !important; border: 0; width: auto; max-width: none; min-width: 0; }
    .vc-tabla td.vc-col-numero { grid-area: numero; }
    .vc-tabla td.vc-col-saldo { grid-area: saldo; font-size: 1.02rem; }
    .vc-tabla td.vc-col-quien { grid-area: quien; }
    .vc-tabla td.vc-col-estado { grid-area: estado; text-align: right; font-size: .88rem; }
    .vc-tabla td.vc-col-importe:not(.vc-col-saldo) { display: none; }
    .vc-tabla td.vc-col-emitido { display: none; }
    .vc-tabla td.vc-col-vence { grid-area: fechas; align-self: center; font-size: .85rem; color: var(--pl-atenuado); }
    .vc-tabla td.vc-col-vence::before { content: "Vence "; }
    .vc-tabla td.vc-col-acc { grid-area: acc; }

    .vc-grilla-3 { grid-template-columns: 1fr 1fr; }
    .vc-grilla-3 > :first-child { grid-column: 1 / -1; }
    .vc-grilla-2 { grid-template-columns: 1fr; }
    .vc-cobro-medio { grid-template-columns: 1fr; }
    .vc-datos { grid-template-columns: 1fr 1fr; }
    .vc-ficha { grid-template-columns: 1fr; gap: 0; }
    .vc-ficha dd { margin-bottom: .45rem; }
    .vc-uso { grid-template-columns: minmax(0, 1fr) auto; }
    .vc-uso-fecha { grid-column: 1 / -1; font-size: .8rem; }
    .vc-modal .modal-footer { flex-wrap: wrap; }
    .vc-modal .modal-footer > .pl-btn { flex: 1 1 auto; }
    .vc-total { width: 100%; }
    .vc-btn-peligro-contorno { margin-right: 0 !important; }
}
