/* ============================================================
   DEVIS PARC INFORMATIQUE — Page styles
   ============================================================ */

.back-nav {
    max-width: 960px;
    margin: 2rem auto 0;
    padding: 0 2rem;
}

.back-nav--bottom {
    margin-top: 3rem;
    margin-bottom: 1rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ── Conteneur principal ── */
.report-container {
    max-width: 960px;
    margin: 1.5rem auto 4rem;
    padding: 2.5rem;
    background: var(--bg-primary);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
}

/* ── En-tête du devis ── */
.devis-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
    padding-bottom: 2rem;
    border-bottom: 3px solid #3b82f6;
    margin-bottom: 2rem;
}

.devis-title-block h1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 2.25rem;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

.devis-title-block h1 svg {
    width: 2rem;
    height: 2rem;
}

.company-tagline {
    color: var(--text-secondary);
    font-style: italic;
    font-size: 1rem;
    margin: 0;
}

.devis-meta-block {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 1.25rem 1.5rem;
    min-width: 240px;
}

.meta-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.35rem 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

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

.meta-label {
    font-weight: 600;
    color: #3b82f6;
    white-space: nowrap;
}

.meta-value {
    color: var(--text-primary);
}

/* ── Bloc destinataire ── */
.devis-parties {
    margin-bottom: 2.5rem;
}

.partie-block {
    background: var(--bg-secondary);
    border-left: 4px solid #3b82f6;
    border-radius: 0 8px 8px 0;
    padding: 1.25rem 1.5rem;
    display: inline-block;
    min-width: 260px;
}

.partie-title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #3b82f6;
    margin-bottom: 0.75rem;
}

.partie-block p {
    margin: 0.2rem 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.partie-block p:first-of-type strong {
    font-size: 1.05rem;
    color: var(--text-primary);
}

.ref-client {
    margin-top: 0.75rem !important;
    font-size: 0.85rem;
}

/* ── Sections ── */
.report-section {
    margin-bottom: 3rem;
}

.report-section h2 {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #3b82f6;
    font-size: 1.4rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.report-section h2 svg {
    width: 1.2rem;
    height: 1.2rem;
}

.report-section h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #3b82f6;
    font-size: 1.1rem;
    margin: 2rem 0 1rem;
}

.report-section h3 svg {
    width: 1rem;
    height: 1rem;
}

.section-intro {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    font-style: italic;
}

/* ── Tableaux ── */
.table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    margin-bottom: 1.5rem;
}

.devis-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.devis-table thead tr {
    background: #3b82f6;
    color: #fff;
}

.devis-table th {
    padding: 0.85rem 1rem;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.devis-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    color: var(--text-secondary);
}

.devis-table tbody tr:last-child td {
    border-bottom: none;
}

.devis-table tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

.devis-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* ── Totaux ── */
.devis-totaux {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    padding: 1.25rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    gap: 3rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    min-width: 320px;
}

.total-row .total-label {
    font-weight: 500;
}

.total-row .total-value {
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
}

.total-final {
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    border-top: 2px solid #3b82f6;
    font-size: 1.1rem !important;
    color: var(--text-primary) !important;
}

.total-final .total-label,
.total-final .total-value {
    color: #3b82f6 !important;
    font-weight: 700 !important;
}

/* ── Section signature ── */
.signature-section p {
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.7;
}

.signature-block {
    margin: 1.5rem 0;
    padding: 1.25rem;
    border: 1px dashed #3b82f6;
    border-radius: 8px;
}

.signature-block p {
    margin-bottom: 1rem;
}

.signature-line {
    border-bottom: 2px solid var(--text-primary);
    width: 60%;
    margin-top: 2rem;
}

.merci {
    color: #3b82f6 !important;
    font-size: 1.05rem;
    margin-top: 1.5rem !important;
}

/* ── Grille produits ── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.product-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    padding: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
}

.product-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}

.product-ref {
    background: #3b82f6;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    margin-top: 2px;
}

.product-header h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.4;
}

.product-qty {
    font-size: 0.8rem;
    color: #3b82f6;
    font-weight: 600;
}

.product-details {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.product-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    font-size: 0.85rem;
}

.product-detail-row span {
    color: var(--text-secondary);
    white-space: nowrap;
}

.product-detail-row strong {
    color: var(--text-primary);
    text-align: right;
    font-weight: 500;
}

.product-detail-row.price strong {
    color: #3b82f6;
    font-weight: 700;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .report-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .devis-header {
        flex-direction: column;
    }

    .devis-meta-block {
        width: 100%;
        min-width: unset;
    }

    .total-row {
        min-width: unset;
        width: 100%;
    }

    .devis-totaux {
        align-items: stretch;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }
}
