* { box-sizing: border-box; }
body { font-family: Arial, sans-serif; margin: 0; background: #f4f6f8; color: #222; }

/* --- Navigation --- */
.navbar { background: #2c3e50; color: #fff; padding: 0 25px; display: flex; align-items: center; justify-content: space-between; }
.navbar .logo { font-weight: bold; font-size: 1.2em; padding: 16px 0; }
.navbar nav a { color: #ecf0f1; text-decoration: none; padding: 18px 14px; display: inline-block; font-size: 0.95em; }
.navbar nav a:hover, .navbar nav a.actif { background: #1a252f; }

/* --- Conteneur général --- */
.conteneur { max-width: 1100px; margin: 0 auto; padding: 25px; }
.carte { background: #fff; border-radius: 8px; padding: 25px; margin-bottom: 25px; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
h1 { color: #2c3e50; margin-top: 0; }
h2, h3 { color: #2c3e50; }

/* --- Messages --- */
.alerte { padding: 12px 18px; border-radius: 6px; margin-bottom: 20px; }
.alerte-succes { background: #eafaf1; border: 1px solid #27ae60; color: #1e8449; }
.alerte-erreur { background: #fdecea; border: 1px solid #e74c3c; color: #c0392b; }
.alerte-erreur ul { margin: 5px 0 0 20px; padding: 0; }

/* --- Formulaires --- */
.grille2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
fieldset { border: 1px solid #ddd; border-radius: 6px; padding: 15px 20px; }
legend { font-weight: bold; color: #2c3e50; padding: 0 8px; }
label { display: block; margin-top: 10px; font-size: 0.9em; color: #444; }
input[type=text], input[type=number], input[type=date], input[type=email], input[type=tel], select, textarea {
    width: 100%; padding: 8px; margin-top: 4px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.95em; font-family: inherit;
}

/* --- Boutons --- */
.btn { cursor: pointer; border: none; border-radius: 5px; padding: 9px 16px; font-size: 0.9em; text-decoration: none; display: inline-block; }
.btn-primaire { background: #27ae60; color: #fff; }
.btn-secondaire { background: #95a5a6; color: #fff; }
.btn-info { background: #2980b9; color: #fff; }
.btn-danger { background: #e74c3c; color: #fff; }
.btn-petit { padding: 5px 10px; font-size: 0.8em; }
.btn-ajouter { background: #ecf0f1; color: #2c3e50; margin-top: 12px; }

/* --- Tableaux --- */
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
table th, table td { padding: 10px; border-bottom: 1px solid #eee; text-align: left; }
table th { background: #2c3e50; color: #fff; font-size: 0.85em; }
table tr:hover { background: #f9fafb; }
.text-droite { text-align: right !important; }
.text-centre { text-align: center !important; }

/* --- Badges statut --- */
.badge { padding: 3px 10px; border-radius: 12px; font-size: 0.78em; font-weight: bold; }
.badge-devis { background: #eaf2fa; color: #2980b9; }
.badge-facture { background: #eafaf1; color: #27ae60; }
.badge-bon_livraison { background: #fef5e7; color: #d68910; }
.badge-brouillon { background: #f2f3f4; color: #7f8c8d; }
.badge-valide { background: #eafaf1; color: #27ae60; }
.badge-annule { background: #fdecea; color: #c0392b; }

/* --- Barre d'actions --- */
.barre-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; flex-wrap: wrap; gap: 10px; }
.recherche input { width: 260px; }

/* --- Lignes de saisie articles --- */
.col-desig { width: 34%; }
.col-qte, .col-pu, .col-tva { width: 15%; }
.col-suppr { width: 8%; text-align: center; }

/* --- Document imprimable --- */
.doc-entete { display: flex; justify-content: space-between; margin-bottom: 20px; }
.bloc-info { width: 48%; }
.bloc-info h3 { border-bottom: 2px solid #2c3e50; padding-bottom: 4px; }
.totaux { width: 350px; margin-left: auto; margin-top: 25px; }
.totaux td { border: none; padding: 5px 10px; }
.totaux tr.ttc td { font-weight: bold; font-size: 1.1em; border-top: 2px solid #2c3e50; }
.lettres { margin-top: 20px; font-style: italic; }
.actions-impression { text-align: right; margin-bottom: 15px; }

/* --- Dashboard --- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 25px; }
.stat-carte { background: #fff; border-radius: 8px; padding: 20px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.stat-carte .chiffre { font-size: 1.8em; font-weight: bold; color: #2c3e50; }
.stat-carte .libelle { color: #7f8c8d; font-size: 0.9em; }

@media print {
    .no-print { display: none !important; }
    body { background: #fff; }
    .conteneur { max-width: 100%; padding: 0; }
    .carte { box-shadow: none; }
}
