h2 {
    margin-top: 0 !important;
}

.doc-table {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.doc-header {
    display: grid;
    grid-template-columns: 50px 1.5fr 1fr 1fr 50px;
    padding: 12px 16px;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted-light);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
}

.doc-row {
    display: grid;
    grid-template-columns: 50px 1.5fr 1fr 1fr 50px;
    padding: 16px;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    text-decoration: none !important;
    color: inherit;
}

.doc-row:hover {
    background: rgba(255, 255, 255, 0.04);
    transform: translateX(4px);
    border-left: 2px solid var(--accent);
}

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

.doc-icon-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--muted-light);
    opacity: 0.7;
}

.doc-info-cell {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.doc-ref {
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
}

.doc-date {
    font-size: 0.85rem;
    color: var(--muted-light);
}

.doc-amount-cell {
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    text-align: right;
    padding-right: 15px;
}

.doc-action-cell {
    display: flex;
    justify-content: flex-end;
}

.btn-icon-download {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: background 0.2s;
}

.doc-row:hover .btn-icon-download {
    background: var(--primary);
}

@media (max-width: 768px) {
    .doc-header {
        display: none;
    }

    .doc-row {
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "info amount"
            "status action";
        gap: 10px;
    }

    .doc-icon-cell {
        display: none;
    }

    .doc-info-cell {
        grid-area: info;
    }

    .doc-amount-cell {
        grid-area: amount;
        text-align: right;
        padding-right: 0;
    }

    .doc-status-cell {
        grid-area: status;
    }

    .doc-action-cell {
        grid-area: action;
        justify-content: flex-end;
    }
}

/* --- ACCORDÉON DEVIS --- */
.doc-group {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.doc-row.clickable {
    cursor: pointer;
    border-bottom: none;
}

.doc-group.active .fa-chevron-down {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.doc-details {
    display: none;
    background: rgba(0, 0, 0, 0.2);
    padding: 0 0 10px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.3s ease;
}

.doc-group.active .doc-details {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Structure du tableau des items */
.line-items-header {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr; /* Desc | Qté | Prix | Total */
    padding: 8px 16px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.02);
}

.line-item-row {
    display: grid;
    grid-template-columns: 3fr 1fr 1fr 1fr;
    padding: 10px 16px;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    align-items: flex-start;
}

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

.li-desc-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.li-name {
    color: #fff;
    font-weight: 500;
}

.li-desc {
    font-size: 0.85rem;
    font-style: italic;
}

/* Responsive Mobile pour les items */
@media (max-width: 600px) {
    .line-items-header {
        display: none;
    }

    .line-item-row {
        grid-template-columns: 1fr auto;
        gap: 6px;
    }

    .li-desc-block {
        grid-column: 1 / -1;
        margin-bottom: 4px;
    }
}