* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f4f6f5;
    color: #26311f;
}
a { color: inherit; text-decoration: none; }

/* --- Page de connexion --- */
.page-connexion {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(160deg, #f4f6f5 0%, #eaf2e6 100%);
}
.carte-connexion {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(20, 30, 15, 0.1);
    padding: 36px 32px;
    margin: 20px;
}
.logo-connexion { text-align: center; margin-bottom: 24px; }
.logo-connexion i { font-size: 34px; color: #2e7d32; }
.logo-connexion-img { height: 52px; width: auto; object-fit: contain; margin-bottom: 6px; }
.logo-connexion h1 { font-size: 22px; margin: 8px 0 2px; }
.logo-connexion p { font-size: 12.5px; color: #9aa294; margin: 0; }
.note-connexion { font-size: 12px; color: #9aa294; text-align: center; margin-top: 16px; }

/* --- En-tête / navigation --- */
.entete-site {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid #edf1ea;
    flex-wrap: wrap;
}
.entete-marque { font-weight: 700; font-size: 16px; color: #2e7d32; display: flex; align-items: center; gap: 8px; }
.logo-marque { height: 28px; width: auto; object-fit: contain; }
.barre-recherche { display: flex; flex: 1; min-width: 200px; max-width: 420px; }
.barre-recherche input {
    flex: 1; padding: 8px 12px; border: 1px solid #e6e9e3; border-radius: 8px 0 0 8px; font-size: 13px; outline: none;
}
.barre-recherche button {
    padding: 8px 14px; border: none; background: #2e7d32; color: #fff; border-radius: 0 8px 8px 0; cursor: pointer;
}
.nav-principale { display: flex; gap: 4px; flex-wrap: wrap; }
.nav-principale a {
    padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: #55614d; transition: background 0.15s;
}
.nav-principale a:hover { background: #f1f6ee; }
.entete-utilisateur { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #55614d; }
.entete-utilisateur a { color: #b93d34; font-size: 16px; }

/* --- Layout général --- */
.conteneur-page { max-width: 1100px; margin: 24px auto; padding: 0 20px; }
.conteneur-page h1 { font-size: 21px; margin: 0 0 18px; display: flex; align-items: center; gap: 10px; color: #26311f; }
.carte {
    background: #fff; border-radius: 12px; border: 1px solid #edf1ea; padding: 20px;
    margin-bottom: 20px; box-shadow: 0 2px 10px rgba(20,30,15,0.04);
}
.carte h3 { margin: 0 0 14px; font-size: 15px; color: #26311f; }
.texte-vide { color: #9aa294; font-size: 13px; }
.texte-secondaire { color: #8a9186; font-size: 12px; display: block; margin-top: 2px; }
.fil-ariane { margin-bottom: 14px; font-size: 13px; }
.fil-ariane a { color: #2e7d32; font-weight: 600; }

/* --- Formulaires --- */
.formulaire-carte, .carte form { display: flex; flex-direction: column; gap: 14px; }
.ligne-champs { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.groupe-champ { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 160px; }
.groupe-champ label { font-size: 12px; font-weight: 600; color: #55614d; }
.groupe-champ input, .groupe-champ select, .groupe-champ textarea,
input[type=text], input[type=email], input[type=password], select, textarea {
    padding: 9px 12px; border: 1px solid #e6e9e3; border-radius: 8px; font-size: 13.5px; font-family: inherit; outline: none;
}
.groupe-champ input:focus, .groupe-champ select:focus, .groupe-champ textarea:focus,
input:focus, select:focus, textarea:focus { border-color: #8cc46b; }
.action-inline { border-top: 1px solid #f0f2ee; padding-top: 14px; margin-top: 14px; }
.action-inline:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.action-inline textarea { width: 100%; margin-bottom: 8px; }

.btn-principal, .btn-secondaire, .btn-danger {
    padding: 10px 18px; border: none; border-radius: 8px; font-weight: 600; font-size: 13px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
}
.btn-principal { background: #2e7d32; color: #fff; }
.btn-principal:hover { background: #256b29; }
.btn-secondaire { background: #eef2eb; color: #55614d; }
.btn-secondaire:hover { background: #e2e8dd; }
.btn-danger { background: #fdecea; color: #b23b3b; }
.btn-danger:hover { background: #f8d7d3; }
.btn-icon { border: none; background: #f1f6ee; color: #55614d; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn-icon:hover { background: #e2e8dd; }

.alerte-erreur { background: #fdecea; color: #b23b3b; border: 1px solid #f8b8b8; border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 16px; }

/* --- Onglets --- */
.onglets { display: flex; gap: 4px; border-bottom: 1px solid #edf1ea; margin-bottom: 18px; flex-wrap: wrap; }
.onglet { padding: 10px 14px; font-size: 13px; font-weight: 600; color: #55614d; border-bottom: 2px solid transparent; }
.onglet:hover { color: #2e7d32; }
.onglet.actif { color: #2e7d32; border-bottom-color: #2e7d32; }

/* --- Filtres --- */
.barre-filtres { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.barre-filtres input, .barre-filtres select { padding: 9px 12px; border: 1px solid #e6e9e3; border-radius: 8px; font-size: 13px; }

/* --- Tableaux --- */
.table-scroll { overflow-x: auto; }
.tableau-tickets { width: 100%; border-collapse: collapse; font-size: 13px; }
.tableau-tickets th { text-align: left; padding: 10px 12px; color: #8a9186; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid #edf1ea; }
.tableau-tickets td { padding: 10px 12px; border-bottom: 1px solid #f4f6f2; }
.tableau-tickets tbody tr[onclick] { cursor: pointer; }
.tableau-tickets tbody tr[onclick]:hover { background: #fafbf9; }
.action-buttons { display: flex; gap: 6px; }
.table-infos { width: 100%; border-collapse: collapse; font-size: 13px; }
.table-infos td { padding: 6px 0; }
.table-infos td:first-child { color: #8a9186; width: 45%; }

/* --- Badges --- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: #fff; }
.badge-categorie { background: #607d8b; }
.badges-ticket { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }

/* --- Détail ticket --- */
.entete-ticket h1 { margin-bottom: 8px; }
.grille-ticket { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.fil-evenements { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.fil-evenements li { border-left: 3px solid #e6e9e3; padding-left: 12px; }
.evenement-entete { display: flex; gap: 10px; align-items: center; font-size: 12.5px; flex-wrap: wrap; }
.evenement-type { color: #2e7d32; font-weight: 600; }
.evenement-date { color: #9aa294; margin-left: auto; }

/* --- Dashboard --- */
.grille-compteurs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.carte-compteur {
    background: #fff; border: 1px solid #edf1ea; border-radius: 12px; padding: 18px; text-align: center;
    box-shadow: 0 2px 10px rgba(20,30,15,0.04); transition: transform 0.15s;
}
.carte-compteur:hover { transform: translateY(-2px); }
.carte-compteur .valeur { display: block; font-size: 28px; font-weight: 800; color: #2e7d32; }
.carte-compteur.alerte .valeur { color: #c98a2e; }
.carte-compteur .libelle { font-size: 12.5px; color: #666; }

.liste-relances { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.liste-relances li { border-bottom: 1px solid #f4f6f2; padding-bottom: 10px; }
.liste-relances a { color: #26311f; font-weight: 600; font-size: 13.5px; }

@media screen and (max-width: 768px) {
    .grille-ticket { grid-template-columns: 1fr; }
    .entete-site { flex-direction: column; align-items: stretch; }
    .nav-principale { justify-content: center; }
}
