/* Exchange Reports Layout */
.exchange-list {
    margin-top: 3rem;
}

#exchangesContainer, #finalizedContainer {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    width: 100%;
    justify-content: flex-start;
}

/* Exchange Item Card */
.exchange-item {
    flex: 0 1 340px;
    width: 340px;
    height: 520px; /* Definindo uma altura fixa para garantir paridade total */
    padding: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-top: 4px solid var(--primary);
}

.exchange-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.exchange-item.is-finalized {
    border-top-color: var(--success);
}

/* Card Internals */
.card-topbar {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.supplier-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.exchange-header-content {
    display: flex;
    flex-direction: column;
}

.exchange-header-content h3 {
    font-size: 1rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    line-height: 1.2;
}

.exchange-header-content .date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.exchange-header .date {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    flex: 1;
}

.card-actions {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    margin-bottom: 0.5rem;
}

/* Products Table */
.products-table {
    background: rgba(15, 23, 42, 0.4);
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--glass-border);
}

.table-header {
    display: grid;
    grid-template-columns: 2.5fr 1.5fr 0.5fr;
    padding: 0.75rem 1rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
}

.table-body {
    max-height: 300px;
    overflow-y: auto;
}

.product-item-row {
    display: grid;
    grid-template-columns: 2.5fr 1.5fr 0.5fr;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    transition: background 0.2s ease;
}

.product-item-row:last-child {
    border-bottom: none;
}

.product-item-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.01);
}

.product-item-row:hover {
    background: rgba(56, 189, 248, 0.05);
}

.p-name {
    color: var(--text-main);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.p-barcode {
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
}

.p-qty {
    color: var(--primary);
    font-weight: 700;
    text-align: right;
    font-size: 1rem;
}

/* Card Footer */
.exchange-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.exchange-footer strong {
    color: var(--text-main);
}

/* Status Badges in Cards */
.status-badge {
    padding: 0.4rem 1rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Responsive Exchanges */
@media (max-width: 768px) {
    #exchangesContainer, #finalizedContainer {
        gap: 1rem;
    }

    .exchange-item {
        flex: 1 1 100%;
        width: 100%;
        height: auto;
        min-height: auto;
    }

    .card-body {
        padding: 1.25rem;
    }

    .table-header {
        font-size: 0.65rem;
        padding: 0.6rem;
    }

    .product-item-row {
        padding: 0.6rem;
        font-size: 0.85rem;
    }
}

.status-badge.finalized {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.1);
}

.status-badge.finalized::before {
    content: '\f058';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}
