:root {
    --texte: #222;
    --fond: #f6f7f9;
    --carte: #fff;
    --bordure: #d9dce1;
    --accent: #1f5fbf;
    --accent-fonce: #174a96;
    --danger: #b00020;
    --succes: #1b7a3d;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--texte);
    background: var(--fond);
    line-height: 1.45;
}

a { color: var(--accent); }

h1 { font-size: 1.4rem; margin: 0 0 8px; }

.entete {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: center;
    padding: 12px 24px;
    background: var(--carte);
    border-bottom: 1px solid var(--bordure);
}

.entete__logo { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--texte); }
.entete__menu { display: flex; flex-wrap: wrap; gap: 16px; }
.entete__menu a { text-decoration: none; font-weight: 500; }

.contenu { max-width: 1100px; margin: 0 auto; padding: 24px 16px 80px; }

.aide { color: #666; margin: 0 0 16px; }

.message { padding: 10px 14px; border-radius: 6px; margin: 0 0 16px; }
.message--succes { background: #e5f5ea; color: var(--succes); }
.message--erreur { background: #fbe7ea; color: var(--danger); }

/* Formulaires */
.carte-formulaire {
    max-width: 420px;
    margin: 24px auto;
    padding: 24px;
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: 8px;
}
.carte-formulaire--large { max-width: 640px; margin: 16px 0; }

.carte-formulaire form > div,
.carte-formulaire form > p { margin-bottom: 14px; }

label { display: block; font-size: .9rem; font-weight: 600; margin-bottom: 4px; }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="tel"], input[type="url"], input[type="date"], select, textarea {
    width: 100%;
    font: inherit;
    padding: 8px 10px;
    border: 1px solid var(--bordure);
    border-radius: 6px;
    background: #fff;
}

form ul li { color: var(--danger); }

.recherche {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
    margin-bottom: 12px;
}
.recherche label { flex: 1 1 160px; margin: 0; }
.recherche label:first-child { flex: 2 1 260px; }

.etat { font-weight: 600; margin: 8px 0 12px; }

/* Boutons */
.bouton {
    display: inline-block;
    font: inherit;
    font-weight: 600;
    padding: 9px 16px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}
.bouton:hover { background: var(--accent-fonce); }
.bouton:disabled { opacity: .6; cursor: default; }
.bouton--petit { padding: 4px 10px; font-size: .85rem; }
.bouton--clair { background: #fff; color: var(--accent); }
.bouton--clair:hover { background: #eef3fb; }
.bouton--danger { background: #fff; color: var(--danger); border-color: var(--danger); }
.bouton--danger:hover { background: #fbe7ea; }
.bouton--actif { background: var(--succes); border-color: var(--succes); }

.formulaire-en-ligne { display: inline-block; margin: 0 4px 4px 0; }
.formulaire-suppression { margin-top: 24px; }

/* Tableaux */
.tableau-conteneur { overflow-x: auto; }
.tableau { border-collapse: collapse; width: 100%; background: var(--carte); font-size: .92rem; }
.tableau th, .tableau td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--bordure); vertical-align: top; }
.tableau th { background: #eef0f3; }

/* Filtres et badges */
.filtres { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 16px; }
.filtre { padding: 5px 12px; border: 1px solid var(--bordure); border-radius: 999px; background: #fff; text-decoration: none; font-size: .9rem; }
.filtre--actif { background: var(--accent); color: #fff; border-color: var(--accent); }

.badge { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .8rem; background: #e6e8ec; }
.badge--a_visiter { background: #e6e8ec; }
.badge--visite { background: #e3eefb; color: #174a96; }
.badge--interesse { background: #e5f5ea; color: var(--succes); }
.badge--refuse { background: #fbe7ea; color: var(--danger); }
.badge--client { background: #fff1cc; color: #7a5600; }

/* Tournée */
.tournee { list-style: none; counter-reset: arret; padding: 0; margin: 16px 0 0; }
.tournee__arret {
    counter-increment: arret;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    padding: 14px 16px 14px 56px;
    margin-bottom: 10px;
    background: var(--carte);
    border: 1px solid var(--bordure);
    border-radius: 8px;
    position: relative;
    color: var(--texte);
}
.tournee__arret::before {
    content: counter(arret);
    position: absolute;
    left: 14px;
    top: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    text-align: center;
    line-height: 28px;
}
.tournee__actions { display: flex; flex-wrap: wrap; align-items: start; }

/* Carte intégrée */
.carte-panneau {
    position: fixed;
    right: 16px;
    bottom: 16px;
    width: min(520px, 94vw);
    height: 440px;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .3);
    z-index: 10;
}
.carte-panneau[hidden] { display: none; }
.carte-panneau__entete { display: flex; gap: 10px; align-items: center; padding: 8px; background: #f4f4f4; font-size: .85rem; }
.carte-panneau__entete strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-panneau iframe { flex: 1; border: 0; width: 100%; }

/* Mot de passe : petit œil */
.champ-mdp { position: relative; display: block; }
.champ-mdp input { padding-right: 44px; }
.champ-mdp__oeil {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

/* Recherches enregistrées */
.recherches-enregistrees { margin-bottom: 20px; }
.recherches-enregistrees h2 { font-size: 1rem; margin: 0 0 6px; }
.puce-recherche { display: inline-flex; align-items: center; gap: 4px; }
