.resultado-main {
    max-width: 620px;
}

.logo-wrap--chico {
    margin-bottom: 1rem;
}

.logo--chico {
    max-width: 220px;
}

.reporte-header {
    text-align: center;
    margin-bottom: 1.6rem;
}

.reporte-header h1 {
    font-size: 1.3rem;
    margin-bottom: 0.2rem;
}

.reporte-cuit {
    color: var(--text-sub);
    font-size: 0.85rem;
    margin-bottom: 0;
}

.tarjeta {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.2rem 1.4rem;
    margin-bottom: 1rem;
    text-align: left;
}

.tarjeta h2 {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--accent);
    margin-bottom: 0.7rem;
    font-weight: 700;
    text-align: left;
}

.linea-dato {
    font-size: 0.92rem;
    color: var(--text);
    text-align: left;
    margin-bottom: 0.4rem;
}

.linea-dato:last-child {
    margin-bottom: 0;
}

.dato-hint {
    color: var(--hint);
    font-size: 0.78rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: var(--accent);
    color: #fff;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

.barra-progreso {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 0.9rem;
}

.barra-progreso-relleno {
    height: 100%;
    background: var(--accent);
    border-radius: 6px;
    transition: width 0.4s ease;
}

.fila-monto {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.fila-monto-derecha {
    text-align: right;
}

.monto-grande {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}

.boton-volver {
    display: block;
    text-align: center;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.88rem;
    margin: 1.4rem 0 0.6rem;
    transition: color 0.2s;
}

.boton-volver:hover {
    color: var(--accent-hover);
}

.estado-error {
    text-align: center;
    padding: 1rem 0 0.5rem;
}

.estado-error-icono {
    font-size: 1.7rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fdecea;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

#main-card.main-card--error {
    border-top: 4px solid #d64545;
}

.estado-error h1 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
}

.estado-error-mensaje {
    color: var(--text-sub);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* --- Estados de carga / oculto / animacion escalonada --- */

.oculto {
    display: none !important;
}

#vista-cargando {
    text-align: center;
    padding: 1.5rem 0 1rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0.8rem auto 1.4rem;
    animation: girar 0.8s linear infinite;
}

@keyframes girar {
    to {
        transform: rotate(360deg);
    }
}

.texto-cargando {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
    margin-bottom: 0;
    min-height: 1.4em;
    transition: opacity 0.2s;
}

.reveal {
    opacity: 0;
    animation: aparecer 0.45s ease forwards;
}

@keyframes aparecer {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Tarjeta principal mas ancha al mostrar resultados (ancho fluido) --- */
#main-card.resultado-main {
    width: min(92vw, 720px);
    max-width: none;
}

@media (min-width: 720px) {
    #main-card.resultado-main {
        padding-left: 2.6rem;
        padding-right: 2.6rem;
    }
}

.tarjeta-proximamente {
    border-style: dashed;
    opacity: 0.85;
}

.tarjeta-proximamente h2 {
    color: var(--hint);
}

/* --- Titulo de seccion y link externo --- */
.titulo-seccion {
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 1px;
    color: var(--hint);
    font-weight: 700;
    text-align: left;
    margin: 0.4rem 0 0.6rem;
}

.link-externo {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.link-externo:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.boton-secundario {
    margin-top: 0.8rem;
    width: 100%;
    padding: 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.boton-secundario:hover {
    background: var(--accent);
    color: #fff;
}

/* ============================================================
   Pantalla de Ventas (rediseño): tarjeta ancha, totales lado a
   lado, tablas con formato prolijo, semáforo de categoría
   ============================================================ */

#main-card.ventas-main {
    width: min(96vw, 1500px);
    max-width: none;
}

@media (min-width: 1020px) {
    #main-card.ventas-main {
        padding-left: 2.6rem;
        padding-right: 2.6rem;
    }
}

.totales-fila {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.total-caja {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.total-caja--derecha {
    text-align: right;
}

.proyeccion-caja {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
    border: 1px dashed var(--border);
    border-radius: 10px;
    background: var(--bg);
}

/* --- Semáforo de utilización del tope --- */
.barra-progreso-relleno--verde {
    background: #2e9e5b;
}

.barra-progreso-relleno--amarillo {
    background: #e0a72c;
}

.barra-progreso-relleno--rojo {
    background: #d64545;
}

/* --- Tablas de detalle de ventas, lado a lado --- */
.tabla-columnas {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
}

@media (min-width: 720px) {
    .tabla-columnas {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }
}

.tabla-columnas > div h2 {
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tabla-scroll {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.tabla-ventas {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.tabla-ventas thead th {
    text-align: center;
    color: #fff;
    background: var(--accent);
    padding: 0.55rem 0.6rem;
    font-weight: 600;
    white-space: nowrap;
}

.tabla-ventas tbody td {
    padding: 0.5rem 0.6rem;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    color: var(--text);
    white-space: nowrap;
    text-align: center;
}

.tabla-ventas tbody td:last-child {
    border-right: none;
}

.tabla-ventas tbody tr:nth-child(even) {
    background: var(--bg);
}

.tabla-ventas tbody tr:last-child td {
    border-bottom: none;
}

.tabla-ventas tfoot td {
    padding: 0.55rem 0.6rem;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
}

.celda-importe {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* --- Badge de tipo de comprobante --- */
.badge-tipo {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-tipo--factura {
    background: rgba(36, 44, 79, 0.12);
    color: var(--accent);
}

[data-theme="dark"] .badge-tipo--factura {
    background: rgba(79, 106, 240, 0.18);
}

.badge-tipo--nc {
    background: rgba(214, 69, 69, 0.14);
    color: #d64545;
}

.badge-tipo--nd {
    background: rgba(224, 167, 44, 0.16);
    color: #a97612;
}

/* --- Comparación de dos categorías en la caja de proyección --- */
.badge-secundario {
    background: var(--border);
    color: var(--text);
}

.fila-categoria-comparacion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
}

.fila-categoria-comparacion--estimada {
    border-bottom: none;
    font-weight: 600;
}

/* --- Caja de cita textual de ARCA (cartel de error explícito) --- */
.cita-error-arca {
    background: var(--bg);
    border: 1px dashed var(--border);
    border-radius: 10px;
    padding: 0.9rem 1.1rem;
    margin: 1rem 0;
    text-align: left;
    font-size: 0.85rem;
    color: var(--text);
}
