/* ============================================================
   Garuda — Portail canin
   CSS maison, sans framework
   ============================================================ */

/* ---------- Variables ---------- */
:root {
    --primaire: #d97706;
    --primaire-fonce: #b45309;
    --primaire-clair: #fef3c7;
    --sidebar-bg: #1c1917;
    --sidebar-texte: #e7e5e4;
    --sidebar-texte-doux: #a8a29e;
    --sidebar-hover: #292524;
    --sidebar-actif: #d97706;
    --fond: #fafaf9;
    --surface: #ffffff;
    --bordure: #e7e5e4;
    --texte: #1c1917;
    --texte-doux: #78716c;
    --texte-leger: #a8a29e;
    --erreur: #dc2626;
    --erreur-fond: #fef2f2;
    --succes: #16a34a;
    --succes-fond: #f0fdf4;
    --info: #0284c7;
    --info-fond: #f0f9ff;
    --rayon: 0.85rem;
    --rayon-sm: 0.5rem;
    --ombre: 0 2px 12px rgba(28, 25, 23, 0.08);
    --ombre-md: 0 4px 20px rgba(28, 25, 23, 0.12);
    --sidebar-largeur: 260px;
    --entete-mobile-h: 60px;
    --transition: 0.2s ease;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--fond);
    color: var(--texte);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--primaire);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--primaire-fonce);
}

ul, ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: 1rem;
}

/* ---------- Sidebar ---------- */
.sidebar {
    width: var(--sidebar-largeur);
    min-height: 100vh;
    background: var(--sidebar-bg);
    color: var(--sidebar-texte);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 200;
    transition: transform var(--transition);
    overflow-y: auto;
}

.sidebar-entete {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid #292524;
}

.sidebar-logo {
    font-size: 2rem;
    line-height: 1;
}

.sidebar-nom {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primaire);
    letter-spacing: -0.02em;
}

.sidebar-slogan {
    font-size: 0.75rem;
    color: var(--sidebar-texte-doux);
}

.nav-liens {
    flex: 1;
    padding: 0.75rem 0;
}

.nav-liens li {
    margin: 0.15rem 0.75rem;
}

.nav-lien {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.9rem;
    border-radius: var(--rayon-sm);
    color: var(--sidebar-texte);
    font-size: 0.95rem;
    transition: background var(--transition), color var(--transition);
    text-decoration: none;
}

.nav-lien:hover {
    background: var(--sidebar-hover);
    color: var(--sidebar-texte);
}

.nav-lien.actif {
    background: var(--primaire);
    color: #fff;
    font-weight: 600;
}

.nav-lien.actif:hover {
    background: var(--primaire-fonce);
    color: #fff;
}

.nav-icone {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-pied {
    padding: 1rem 1.25rem;
    border-top: 1px solid #292524;
    color: var(--sidebar-texte-doux);
    font-size: 0.75rem;
}

/* ---------- Overlay mobile ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 190;
}

/* ---------- Entête mobile ---------- */
.entete-mobile {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--entete-mobile-h);
    background: var(--sidebar-bg);
    color: var(--sidebar-texte);
    align-items: center;
    gap: 1rem;
    padding: 0 1rem;
    z-index: 180;
    box-shadow: var(--ombre);
}

.entete-titre {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primaire);
}

.bouton-burger {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.bouton-burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--sidebar-texte);
    border-radius: 2px;
    transition: all var(--transition);
}

/* ---------- Contenu principal ---------- */
.contenu-principal {
    margin-left: var(--sidebar-largeur);
    flex: 1;
    padding: 2rem;
    min-width: 0;
}

/* ---------- Pied de page ---------- */
.pied-page {
    text-align: center;
    padding: 1rem 2rem;
    color: var(--texte-doux);
    font-size: 0.85rem;
    border-top: 1px solid var(--bordure);
    margin-left: var(--sidebar-largeur);
}

/* ---------- Flash messages ---------- */
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1rem;
    border-radius: var(--rayon-sm);
    margin-bottom: 1rem;
    font-size: 0.95rem;
    animation: glisser-bas 0.25s ease;
}

@keyframes glisser-bas {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.flash-succes {
    background: var(--succes-fond);
    border: 1px solid #bbf7d0;
    color: var(--succes);
}

.flash-erreur {
    background: var(--erreur-fond);
    border: 1px solid #fecaca;
    color: var(--erreur);
}

.flash-info {
    background: var(--info-fond);
    border: 1px solid #bae6fd;
    color: var(--info);
}

.flash-fermer {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: inherit;
    opacity: 0.7;
    flex-shrink: 0;
}

.flash-fermer:hover { opacity: 1; }

.erreurs-liste {
    list-style: disc;
    padding-left: 1.5rem;
}

/* ---------- Page entête ---------- */
.page-entete {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.page-entete h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--texte);
}

.page-sous-titre {
    color: var(--texte-doux);
    margin-top: 0.25rem;
}

.page-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.lien-retour {
    font-size: 0.9rem;
    color: var(--texte-doux);
    margin-bottom: 0.25rem;
    display: inline-block;
}

/* ---------- Grille de statistiques ---------- */
.grille-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.grille-stats-sm {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}

.carte-stat {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 1.25rem 1rem;
    text-align: center;
    box-shadow: var(--ombre);
    text-decoration: none;
    color: var(--texte);
    transition: box-shadow var(--transition), transform var(--transition);
}

.carte-stat:hover {
    box-shadow: var(--ombre-md);
    transform: translateY(-2px);
    color: var(--texte);
}

.carte-stat-icone {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.carte-stat-valeur {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primaire);
    line-height: 1.2;
}

.carte-stat-libelle {
    font-size: 0.85rem;
    color: var(--texte-doux);
    margin-top: 0.25rem;
}

.carte-stat-libelle small {
    display: block;
    font-size: 0.78rem;
    margin-top: 0.15rem;
}

/* ---------- Sections ---------- */
.section-tableau {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--ombre);
}

.section-tableau h2,
.section-tableau h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--texte);
}

.section-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.section-entete h2,
.section-entete h3 {
    margin-bottom: 0;
}

.lien-tout-voir {
    font-size: 0.9rem;
    color: var(--primaire);
    white-space: nowrap;
}

/* ---------- Tableaux ---------- */
.tableau-conteneur {
    overflow-x: auto;
    border-radius: var(--rayon-sm);
}

.tableau {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.tableau th {
    background: var(--fond);
    padding: 0.65rem 0.85rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--texte-doux);
    border-bottom: 2px solid var(--bordure);
    white-space: nowrap;
}

.tableau td {
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--bordure);
    vertical-align: top;
}

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

.tableau tbody tr:hover {
    background: var(--fond);
}

/* ---------- Listes items ---------- */
.liste-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.item-ligne {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--bordure);
    flex-wrap: wrap;
}

.item-ligne:last-child {
    border-bottom: none;
}

.item-principal {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.item-secondaire {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    background: var(--fond);
    border: 1px solid var(--bordure);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--texte-doux);
}

.badge-succes {
    background: var(--succes-fond);
    border-color: #bbf7d0;
    color: var(--succes);
}

.badge-titre {
    font-weight: 600;
    font-size: 0.95rem;
}

.lien-pdf {
    font-size: 0.85rem;
    color: var(--erreur);
    font-weight: 500;
}

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border: 1px solid transparent;
    border-radius: var(--rayon-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primaire {
    background: var(--primaire);
    color: #fff;
    border-color: var(--primaire);
}

.btn-primaire:hover {
    background: var(--primaire-fonce);
    border-color: var(--primaire-fonce);
    color: #fff;
    box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
}

.btn-secondaire {
    background: var(--surface);
    color: var(--texte);
    border-color: var(--bordure);
}

.btn-secondaire:hover {
    background: var(--fond);
    color: var(--texte);
    border-color: #d6d3d1;
}

.btn-danger {
    background: var(--erreur-fond);
    color: var(--erreur);
    border-color: #fecaca;
}

.btn-danger:hover {
    background: var(--erreur);
    color: #fff;
    border-color: var(--erreur);
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.82rem;
}

/* Boutons de navigation GPS */
.nav-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.3rem;
}

.popup-nav-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid #e7e5e4;
}

.btn-waze {
    background: #33ccff;
    color: #000;
    border-color: #33ccff;
    font-weight: 600;
}
.btn-waze:hover {
    background: #00b8e6;
    border-color: #00b8e6;
    color: #000;
    box-shadow: 0 2px 8px rgba(51, 204, 255, 0.45);
}

.btn-gmaps {
    background: #fff;
    color: #1a73e8;
    border-color: #1a73e8;
}
.btn-gmaps:hover {
    background: #e8f0fe;
    color: #1a73e8;
}

.btn-osm {
    background: #fff;
    color: #2c7a2c;
    border-color: #7ebc6f;
}
.btn-osm:hover {
    background: #f0fdf0;
    color: #2c7a2c;
}

/* Sur mobile : Waze mis en avant (pleine largeur, plus grand) */
@media (max-width: 768px) {
    .nav-btns .btn-waze,
    .popup-nav-btns .btn-waze {
        flex: 1 0 100%;
        justify-content: center;
        padding: 0.55rem 1rem;
        font-size: 1rem;
    }
    .nav-btns .btn-gmaps,
    .nav-btns .btn-osm,
    .popup-nav-btns .btn-gmaps,
    .popup-nav-btns .btn-osm {
        flex: 1;
        justify-content: center;
    }
}

/* ---------- Formulaires ---------- */
.formulaire-conteneur {
    max-width: 800px;
}

.formulaire {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.formulaire-horizontal {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
}

.formulaire-horizontal .champ {
    flex: 1;
    min-width: 140px;
}

.formulaire-horizontal .champ-bouton {
    flex: 0;
}

.form-grille-deux {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}

.champ {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.champ label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--texte);
}

.champ-obligatoire label::after {
    content: ' *';
    color: var(--erreur);
}

.champ input,
.champ select,
.champ textarea {
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-sm);
    background: var(--surface);
    color: var(--texte);
    transition: border-color var(--transition), box-shadow var(--transition);
    width: 100%;
}

.champ input:focus,
.champ select:focus,
.champ textarea:focus {
    outline: none;
    border-color: var(--primaire);
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15);
}

.champ textarea {
    resize: vertical;
    min-height: 80px;
}

.aide-champ {
    font-size: 0.8rem;
    color: var(--texte-doux);
}

.champ-cases {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.case-a-cocher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
}

.case-a-cocher input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    cursor: pointer;
    accent-color: var(--primaire);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* ---------- Grille chiens ---------- */
.grille-chiens {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.carte-chien {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    overflow: hidden;
    box-shadow: var(--ombre);
    text-decoration: none;
    color: var(--texte);
    transition: box-shadow var(--transition), transform var(--transition);
    display: flex;
    flex-direction: column;
}

.carte-chien:hover {
    box-shadow: var(--ombre-md);
    transform: translateY(-3px);
    color: var(--texte);
}

.carte-chien-photo {
    position: relative;
    aspect-ratio: 4 / 3;
    background: var(--fond);
    overflow: hidden;
}

.carte-chien-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carte-chien-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--texte-leger);
}

.badge-inactif {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    font-size: 0.75rem;
}

.carte-chien-corps {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.carte-chien-nom {
    font-size: 1.1rem;
    font-weight: 700;
}

.carte-chien-race {
    font-size: 0.9rem;
    color: var(--texte-doux);
}

.carte-chien-infos {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--texte-doux);
    flex-wrap: wrap;
}

.carte-chien-diplomes {
    font-size: 0.85rem;
    color: var(--primaire);
    margin-top: auto;
}

/* ---------- Fiche chien ---------- */
.fiche-chien {}

.fiche-chien-haut {
    display: flex;
    gap: 1.5rem;
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--ombre);
    flex-wrap: wrap;
}

.fiche-chien-photo {
    flex-shrink: 0;
    width: 220px;
    border-radius: var(--rayon-sm);
    overflow: hidden;
    background: var(--fond);
    aspect-ratio: 1;
}

.fiche-chien-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fiche-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    min-height: 220px;
}

.fiche-chien-infos {
    flex: 1;
    min-width: 200px;
}

.fiche-chien-infos h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.liste-definition {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.4rem 1rem;
    font-size: 0.95rem;
}

.liste-definition dt {
    color: var(--texte-doux);
    font-weight: 500;
    white-space: nowrap;
}

.liste-definition dd {
    color: var(--texte);
}

.liste-definition-compact {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem 0.75rem;
    font-size: 0.88rem;
}

.liste-definition-compact dt {
    color: var(--texte-doux);
    font-weight: 500;
    white-space: nowrap;
}

.fiche-stats-rapides {
    display: flex;
    gap: 1rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}

.stat-rapide {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--fond);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-sm);
    padding: 0.75rem 1rem;
    flex: 1;
    min-width: 140px;
}

.stat-rapide-icone {
    font-size: 1.5rem;
}

.stat-rapide-valeur {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primaire);
}

.stat-rapide-libelle {
    font-size: 0.8rem;
    color: var(--texte-doux);
}

.notes-texte {
    background: var(--fond);
    border-left: 3px solid var(--primaire);
    padding: 0.75rem 1rem;
    border-radius: 0 var(--rayon-sm) var(--rayon-sm) 0;
    font-size: 0.95rem;
    color: var(--texte-doux);
}

/* ---------- Photo upload ---------- */
.photo-actuelle {
    margin-bottom: 0.75rem;
}

.photo-actuelle img {
    max-width: 180px;
    border-radius: var(--rayon-sm);
    border: 2px solid var(--bordure);
}

.photo-actuelle small {
    display: block;
    font-size: 0.8rem;
    color: var(--texte-doux);
    margin-top: 0.35rem;
}

.photo-preview {
    max-width: 200px;
    margin-top: 0.5rem;
    border-radius: var(--rayon-sm);
    border: 2px solid var(--primaire);
}

/* ---------- Filtre chien ---------- */
.filtre-chien {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filtre-chien label {
    font-weight: 500;
    color: var(--texte-doux);
}

.filtre-chien select {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-sm);
    background: var(--surface);
    color: var(--texte);
    font-size: 0.95rem;
    cursor: pointer;
}

/* ---------- Graphiques ---------- */
.graphique-conteneur {
    position: relative;
    height: 280px;
}

.graphique-grand {
    height: 350px;
}

/* ---------- Palmarès ---------- */
.grille-diplomes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.carte-diplome {
    background: var(--fond);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: box-shadow var(--transition);
}

.carte-diplome:hover {
    box-shadow: var(--ombre);
}

.carte-diplome-haut {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.carte-diplome-icone {
    font-size: 2rem;
    flex-shrink: 0;
}

.carte-diplome-titre h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.chien-nom-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--primaire-clair);
    color: var(--primaire-fonce);
    border-radius: 100px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.25rem;
}

.carte-diplome-description {
    font-size: 0.88rem;
    color: var(--texte-doux);
    font-style: italic;
}

.carte-diplome-pied {
    margin-top: auto;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- Carte Leaflet ---------- */
.filtres-carte {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--ombre);
}

.form-filtres {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: flex-end;
}

.filtre-groupe {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 130px;
}

.filtre-groupe label {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--texte-doux);
}

.filtre-groupe select {
    padding: 0.45rem 0.75rem;
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-sm);
    background: var(--surface);
    color: var(--texte);
    font-size: 0.9rem;
}

.section-carte-leaflet {
    margin-bottom: 1.5rem;
    border-radius: var(--rayon);
    overflow: hidden;
    box-shadow: var(--ombre);
    border: 1px solid var(--bordure);
}

#carte-leaflet {
    height: 675px;
    width: 100%;
}

.stats-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.stat-categorie {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--fond);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon-sm);
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
}

.stat-cat-icone {
    font-size: 1.1rem;
}

.stat-cat-nb {
    margin-left: auto;
}

/* ---------- Modaux ---------- */
/* Leaflet utilise des z-index jusqu'à 800 — les modaux doivent être au-dessus */
#carte-leaflet {
    position: relative;
    z-index: 0;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 2000; /* au-dessus des couches Leaflet (max ~800) */
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-contenu {
    background: var(--surface);
    border-radius: var(--rayon);
    box-shadow: var(--ombre-md);
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    z-index: 2010;
    animation: apparaitre 0.2s ease;
}

@keyframes apparaitre {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

.modal-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--bordure);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}

.modal-entete h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-fermer {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--texte-doux);
    padding: 0.25rem;
}

.modal-fermer:hover { color: var(--texte); }

.modal .formulaire {
    padding: 1.5rem;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
}

/* ---------- Raccourcis dashboard ---------- */
.section-raccourcis {
    background: var(--surface);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--ombre);
}

.section-raccourcis h2 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.grille-raccourcis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.raccourci {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--fond);
    border: 1px solid var(--bordure);
    border-radius: var(--rayon);
    text-decoration: none;
    color: var(--texte);
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
    transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.raccourci span:first-child {
    font-size: 1.75rem;
}

.raccourci:hover {
    background: var(--primaire-clair);
    border-color: var(--primaire);
    color: var(--primaire-fonce);
    box-shadow: var(--ombre);
}

/* ---------- État vide ---------- */
.etat-vide {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--texte-doux);
}

.etat-vide-icone {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.etat-vide h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--texte);
}

.etat-vide p {
    margin-bottom: 1.5rem;
}

/* ---------- Graphiques stats ---------- */
.grille-graphiques {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.lien-chien {
    color: var(--primaire);
    font-weight: 600;
}

/* ---------- Textes utilitaires ---------- */
.texte-vide {
    color: var(--texte-doux);
    font-style: italic;
    padding: 1rem 0;
}

.texte-doux {
    color: var(--texte-doux);
}

/* ---------- Poids conteneur ---------- */
.poids-conteneur {}

/* ---------- Responsive mobile (max 768px) ---------- */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.ouvert {
        transform: translateX(0);
    }

    .sidebar-overlay.actif {
        display: block;
    }

    .entete-mobile {
        display: flex;
    }

    .contenu-principal {
        margin-left: 0;
        margin-top: var(--entete-mobile-h);
        padding: 1rem;
    }

    .pied-page {
        margin-left: 0;
    }

    .page-entete {
        flex-direction: column;
    }

    .page-entete h1 {
        font-size: 1.4rem;
    }

    .fiche-chien-haut {
        flex-direction: column;
    }

    .fiche-chien-photo {
        width: 100%;
        max-width: 250px;
    }

    .grille-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grille-deux {
        grid-template-columns: 1fr;
    }

    .grille-graphiques {
        grid-template-columns: 1fr;
    }

    .formulaire-horizontal {
        flex-direction: column;
    }

    .grille-chiens {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    #carte-leaflet {
        height: 450px;
    }

    .form-filtres {
        flex-direction: column;
    }

    .filtre-groupe {
        min-width: 0;
        width: 100%;
    }

    .grille-raccourcis {
        grid-template-columns: repeat(2, 1fr);
    }

    .tableau th,
    .tableau td {
        padding: 0.5rem;
        font-size: 0.88rem;
    }
}

@media (max-width: 480px) {
    .grille-stats {
        grid-template-columns: 1fr;
    }

    .grille-chiens {
        grid-template-columns: 1fr;
    }

    .grille-diplomes {
        grid-template-columns: 1fr;
    }
}
