/* ═══════════════════════════════════════════════════════════════
   Compactage du formulaire Nouvelle/Modifier Facture
   Gain vertical ~120-180px sans toucher à la logique interne
   ═══════════════════════════════════════════════════════════════ */

/* 1. Page wrapper : retirer le padding vertical excessif */
body #facture-form {
    padding-top: 0 !important;
}

.container-fluid:has(#facture-form) {
    padding-top: 8px !important;
    padding-bottom: 16px !important;
}

/* 2. En-tête : plus compact, breadcrumb plus petit */
.container-fluid:has(#facture-form) > .d-flex:first-of-type {
    margin-bottom: 12px !important;
}

.container-fluid:has(#facture-form) > .d-flex:first-of-type h1 {
    font-size: 1.4rem !important;
    margin-bottom: 2px !important;
}

.container-fluid:has(#facture-form) > .d-flex:first-of-type h1 .badge {
    font-size: 10.5px !important;
    padding: 2px 8px !important;
}

.container-fluid:has(#facture-form) > .d-flex:first-of-type p {
    font-size: 12px;
    margin-bottom: 0 !important;
}

.container-fluid:has(#facture-form) > .d-flex:first-of-type .btn {
    padding: 6px 14px;
    font-size: 13px;
}

/* 3. Section cards : padding resserré, headers compacts */
#facture-form .facture-card {
    border-radius: 10px;
    margin-bottom: 12px !important;
}

#facture-form .facture-card .section-header {
    padding: 10px 16px !important;
    border-bottom: 1px solid var(--color-border, rgba(0, 0, 0, 0.06));
}

#facture-form .facture-card .section-title {
    font-size: 13px !important;
    font-weight: 600 !important;
    margin: 0 !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

#facture-form .facture-card .section-icon {
    font-size: 15px !important;
}

#facture-form .facture-card .section-content {
    padding: 14px 16px !important;
}

/* 4. Labels et champs plus compacts */
#facture-form .form-label {
    font-size: 12px !important;
    font-weight: 500 !important;
    margin-bottom: 4px !important;
    color: var(--color-text-secondary, #6b7280);
}

#facture-form .form-control,
#facture-form .form-select {
    font-size: 13.5px;
    padding: 6px 10px;
}

#facture-form .mb-3 {
    margin-bottom: 10px !important;
}

#facture-form .mb-4 {
    margin-bottom: 14px !important;
}

/* 5. Tableau d'articles : rangées plus compactes */
#facture-form .articles-table th,
#facture-form .articles-table td {
    padding: 8px 10px !important;
    font-size: 13px;
}

#facture-form .articles-table th {
    font-size: 11px !important;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* 6. Sidebar : padding resserré */
#facture-form .col-lg-3 .facture-card .section-content {
    padding: 12px 14px !important;
}

/* 7. Flash alerts : plus discrètes */
.container-fluid:has(#facture-form) .alert {
    padding: 8px 14px;
    font-size: 13px;
    margin-bottom: 10px !important;
}

/* 8. Bouton de soumission sticky en bas (optionnel mais confortable) */
#facture-form .submit-row,
#facture-form .form-actions {
    position: sticky;
    bottom: 0;
    background: var(--color-bg-primary, #ffffff);
    padding: 10px 14px;
    border-top: 1px solid var(--color-border, rgba(0, 0, 0, 0.08));
    margin: 14px -16px -14px;
    z-index: 10;
}

/* Mode sombre : ajustements */
[data-theme="dark"] #facture-form .facture-card .section-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

/* Responsive : moins agressif sur mobile */
@media (max-width: 768px) {
    .container-fluid:has(#facture-form) > .d-flex:first-of-type h1 {
        font-size: 1.2rem !important;
    }
    #facture-form .facture-card .section-content {
        padding: 12px 14px !important;
    }
}
