  /* Spécifique: champ de recherche des filtres (Safari iOS) */
  .planning-filters input[type="search"],
  .filters-grid input[type="search"] {
    height: 40px !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    padding: 8px 12px !important;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    background-color: #fff;
  }

  /* Réduire les espacements internes du bloc de filtres */
  .filters-grid { 
    row-gap: 6px !important; 
    column-gap: 8px !important; 
    padding: 6px 0 !important; 
    grid-auto-rows: min-content !important; /* hauteur de ligne = contenu */
  }
  .filters-grid > * { 
    margin: 0 !important; 
    align-self: start !important; /* ancre en haut pour éviter centrage vertical */
  }
/**
 * Feuille de style Mobile/Tablette - AMCRE
 * Corrections responsive
 * À charger APRÈS main.css
 */

/* ===================================
   1. GRILLES RESPONSIVE
   =================================== */

@media (max-width: 768px) {
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* === Bloc déplacé depuis main.css (correctifs mobiles globaux) === */
@media (max-width: 640px) {
  /* Empêcher les débordements (réglage doux, sans casser au milieu des mots) */
  .planning-card,
  .sortie-detail__body {
    overflow-wrap: break-word;
    word-break: normal;
  }

  /* Contenir strictement le contenu dans la carte détail (mobile) */
  .sortie-detail__body { overflow-x: hidden; width: 100%; }
  .sortie-detail__body p,
  .sortie-detail__body .text-secondary,
  .sortie-detail__body ul,
  .sortie-detail__body .boat-summary__line,
  .sortie-detail__body .boat-summary__text { max-width: 100%; }

  /* Important: permettre le retour à la ligne dans les lignes flex */
  .sortie-detail__body .flex-row {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  /* Titres (mobile uniquement): éviter la coupe verticale/haute sur 2 lignes (iOS) */
  .card h1,
  .card h2,
  .card h3,
  .card .title,
  .sortie-detail__body .title {
    line-height: 1.3 !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
  }

  /* Uniformiser la hauteur des champs de filtres avec les boutons */
  .filters-grid input[type="search"],
  .filters-grid input[type="text"],
  .filters-grid input[type="date"],
  .filters-grid select,
  .planning-filters input[type="search"],
  .planning-filters input[type="text"],
  .planning-filters input[type="date"],
  .planning-filters select,
  .form-control:not(textarea) {
    height: 40px !important;
    line-height: normal; /* évite la sur-hauteur iOS */
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    font-size: 16px; /* évite le zoom iOS */
    min-width: 0; /* évite la croissance hors conteneur */
    box-sizing: border-box;
  }

  /* iOS: neutraliser le rendu natif des dates pour respecter la hauteur */
  .filters-grid input[type="date"],
  .planning-filters input[type="date"] {
    -webkit-appearance: none;
    appearance: none;
  }

  /* Recherche globale (quel que soit le conteneur) */
  input[type="search"],
  .search-input {
    height: 40px !important;
    min-height: 40px !important;
    line-height: normal !important; /* éviter la sur-hauteur (40px + padding) */
    padding: 8px 12px !important;
    font-size: 16px !important;
    box-sizing: border-box;
    -webkit-appearance: none;
    appearance: none;
    background-clip: padding-box;
  }

  /* iOS Safari: supprimer décorations qui ajoutent de la hauteur aux champs de recherche */
  input[type="search"]::-webkit-search-decoration,
  input[type="search"]::-webkit-search-cancel-button,
  input[type="search"]::-webkit-search-results-button,
  input[type="search"]::-webkit-search-results-decoration { display: none; }

  /* Boutons dans les filtres: 40px pour s'aligner avec les champs */
  .filters-grid .btn,
  .filters-grid .btn-outline,
  .planning-filters .btn,
  .planning-filters .btn-outline {
    height: 40px !important;
    min-height: 40px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  /* Empêcher les filtres de déborder horizontalement */
  .filters-grid,
  .planning-filters {
    min-width: 0;
    width: 100%;
    align-items: stretch !important; /* évite les cellules sur-hautes en centrage vertical */
    padding: 0 !important;
    margin-top: 6px !important;
    margin-bottom: 10px !important;
    grid-template-columns: 1fr !important;
    grid-auto-rows: min-content !important;
  }

  /* Forcer largeur/affichage des champs pour éviter boîtes anormalement hautes */
  .filters-grid input,
  .filters-grid select,
  .planning-filters input,
  .planning-filters select {
    display: block;
    width: 100%;
    min-height: 40px !important;
    margin: 0 !important; /* évite marges verticales cumulées */
    height: auto !important; /* neutralise toute hauteur forcée héritée */
  }

  /* Empêcher les enfants de remplir la hauteur de la cellule */
  .filters-grid > *,
  .planning-filters > * {
    align-self: start !important;
    justify-self: stretch !important;
  }

  /* Compacter les paragraphes et listes dans les cartes et la page détail sortie */
  .card p,
  .sortie-detail__body p,
  .sortie-detail__body .text-secondary {
    margin-top: 6px;
    margin-bottom: 6px;
    line-height: 1.45;
  }

  .sortie-detail__body ul {
    margin-top: 6px;
    margin-bottom: 6px;
    padding-left: 18px;
  }

  /* Réduire le padding interne des cartes sur mobile */
  .card { padding: 12px; box-sizing: border-box; overflow: visible; }

  /* Limiter les débordements sans casser les mots normaux */
  .card p,
  .card h1,
  .card h2,
  .card h3,
  .card .title,
  .card .meta,
  .card .eq-name { 
    overflow-wrap: break-word; 
    word-break: normal; 
    hyphens: auto; 
  }
  .sortie-detail__body p,
  .sortie-detail__body .text-secondary,
  .sortie-detail__body .boat-summary__line,
  .sortie-detail__body .boat-summary__text { 
    overflow-wrap: break-word; 
    word-break: normal; 
    hyphens: auto; 
  }

  /* Actions filtres: pas de décalage à droite en mobile */
  .planning-filters .filters-actions { margin-left: 0 !important; width: 100% !important; }

  /* Éviter l'effet "texte vertical" sur les libellés/titres en candidature */
  .sortie-detail__body label,
  .sortie-detail__body .form-inline,
  .sortie-detail__body .title,
  .candidate label,
  .candidate .form-inline {
    word-break: normal;
    overflow-wrap: normal;
    white-space: normal;
  }

  /* Marge interne à droite/gauche dans le corps des cartes de détail */
  .sortie-detail__body,
  .card__body {
    padding-left: 12px;
    padding-right: 12px;
    box-sizing: border-box;
  }
}

/* Support: paragraphes avec sauts de ligne conservés */
.text-preline { white-space: pre-line; }

/* ===================================
   18. GANTT DISPONIBILITÉS — CONTROLS LAYOUT
   =================================== */
/* Place le bouton à côté du select (desktop et mobile) */
.amcre-planning-controls { display: inline-flex; align-items: center; gap: 10px; margin-right: 12px; flex-wrap: wrap; }
.amcre-planning-controls form { display: inline-flex; align-items: center; gap: 8px; }
.amcre-actions { display: inline-flex; align-items: center; margin: 0 0 20px 10px; vertical-align: middle; }

/* Mobile: compacter l'intitulé du bouton de création de disponibilité */
@media (max-width: 640px) {
  /* Cible uniquement le bouton de création des disponibilités */
  .amcre-actions .btn[href*="disponibilites"] { font-size: 0; padding: 10px 12px; min-height: 44px; }
  .amcre-actions .btn[href*="disponibilites"]::before { content: 'Ajouter dispo'; font-size: 14px; }
}

/* ===================================
   17. ANNUAIRE ADHERENTS — FIX OVERFLOW
   =================================== */
@media (max-width: 640px) {
  /* Empêche tout débordement horizontal des cartes */
  .card, .item { max-width: 100%; box-sizing: border-box; }

  /* Ligne image + texte plus compacte */
  .row { grid-template-columns: 90px 1fr; }
  .thumb { width: 90px; height: 90px; max-width: 100%; object-fit: cover; }

  /* Forcer les longs textes/emails à se couper proprement */
  .meta, .footer, .footer .meta, .footer a { overflow-wrap: anywhere; word-break: break-word; }

  /* Espacements plus serrés dans le pied de carte */
  .footer { gap: 10px; align-items: center; }
}
/* ===================================
   16. PLANNING GANTT — FIX OVERLAP
   =================================== */
/* Fix pour TOUS les écrans (desktop + mobile) */
.bateau-cell { 
  z-index: 50 !important; 
  background: #fff; 
  position: sticky; 
  left: 0; 
}

.bateau-header { 
  z-index: 60 !important; 
}

/* Les barres restent en dessous de la colonne sticky */
.tableau-planning-event { 
  z-index: 1; 
}

/* Ajustements spécifiques mobile si nécessaire */
@media (max-width: 960px) {
  /* Conserve les mêmes valeurs pour cohérence */
  .bateau-cell { z-index: 50 !important; }
  .bateau-header { z-index: 60 !important; }
  .tableau-planning-event { z-index: 1; }
}

/* Boutons navigation mois compacts (mobile) */
@media (max-width: 640px) {
  .month-nav-buttons { gap: 6px; }
  .month-nav-buttons .btn-month-nav {
    width: 36px; height: 36px;
    padding: 0; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0; /* masque le texte "Mois précédent/suivant" */
  }
  .month-nav-buttons .btn-month-nav:first-child::before { content: '◀'; font-size: 16px; line-height: 1; }
  .month-nav-buttons .btn-month-nav:last-child::before  { content: '▶'; font-size: 16px; line-height: 1; }
  .btn-month-nav:disabled { opacity: .4; }
}

@media (max-width: 960px) {
    .card-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .card-list {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   2. HEADER & NAVIGATION
   =================================== */

@media (max-width: 640px) {
    .logo-image {
        height: 48px;
    }
    
    .brand-name {
        font-size: 20px;
    }
    
    .brand-tagline {
        font-size: 14px;
    }
}

/* Menu hamburger */
.menu-toggle {
    display: none;
}

@media (max-width: 960px) {
    /* Hamburger centré verticalement */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 8px;
        cursor: pointer;
        padding: 0;
        margin-right: auto;
        order: -1;
        align-self: center;
    }
    
    .menu-toggle svg {
        width: 24px;
        height: 24px;
        color: #ffffff;
    }
    
    /* Menu caché par défaut, visible uniquement dans le burger */
    .main-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--blue-primary);
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        gap: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
    
    .main-menu.is-open {
        max-height: 500px;
        padding: 12px 16px;
        gap: 8px;
    }
    
    .main-menu > li {
        width: 100%;
    }
    
    .main-menu > li > a {
        display: block;
        padding: 12px 16px;
        border-radius: 6px;
        color: #ffffff;
    }
    
    .main-menu > li > a:hover {
        background: rgba(255, 255, 255, 0.1);
    }
    
    .nav-row {
        position: relative;
        display: flex;
        align-items: center;
        min-height: 50px;
    }
    
    /* Menu auth centré verticalement */
    .auth {
        display: flex;
        align-items: center;
        align-self: center;
    }

    /* ==============================
       FILTRES (toutes pages)
       ============================== */
    .filters-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        align-items: center;          /* Centre verticalement chaque cellule */
        row-gap: 10px;                /* Espacement vertical si wrap */
        column-gap: 10px;             /* Espacement horizontal doux */
    }

    /* Champs de saisie hauteur homogène */
    .filters-grid select,
    .filters-grid input[type="date"],
    .filters-grid input[type="text"] {
        height: 44px;                 /* Même hauteur que boutons */
        padding: 10px 12px;
        line-height: 22px;
    }

    /* Groupe des boutons à droite sur une même ligne */
    .filters-grid .flex-row {
        margin-left: auto !important; /* Pousse à droite si place */
        display: flex;
        align-items: center;          /* Centre verticalement */
        gap: 10px;
        flex-wrap: wrap;              /* Wrap propre si manque d'espace */
    }

    .filters-grid .btn,
    .filters-grid .btn-outline {
        min-height: 44px;             /* Zone tactile */
        padding: 10px 14px;
    }
}

@media (min-width: 961px) {
    .menu-toggle {
        display: none !important;
    }
}

/* ===================================
   3. ZONES TACTILES
   =================================== */

@media (max-width: 768px) {
    .btn,
    .btn-outline,
    .btn-danger {
        padding: 12px 16px;
        min-height: 44px;
        font-size: 15px;
    }
    
    .main-menu > li > a {
        padding: 12px 8px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .auth a,
    .auth button {
        min-height: 44px;
        padding: 12px 16px;
    }
}

/* ===================================
   4. POLICES & LISIBILITÉ
   =================================== */

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }
    
    .category-badge,
    .badge-pill {
        font-size: 13px;
        padding: 5px 8px;
    }
    
    .text-secondary {
        font-size: 15px;
    }
    
    .muted--excerpt {
        font-size: 15px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    h2 {
        font-size: 20px;
    }
    
    h3 {
        font-size: 18px;
    }
}

/* ===================================
   5. FORMULAIRES & FILTRES
   =================================== */

@media (max-width: 640px) {
    .filters-grid .flex-row {
        margin-left: 0 !important;
        flex-direction: column;
        width: 100%;
    }
    
    .filters-grid .btn,
    .filters-grid .btn-outline {
        width: 100%;
        justify-content: center;
    }
    
    .form-control,
    .form-select,
    .form-textarea {
        padding: 12px 14px;
        font-size: 16px;
    }
    
    .search-input {
        padding: 12px 14px;
        font-size: 16px;
    }
}

/* ===================================
   6. CARTES & PLANNING
   =================================== */

@media (max-width: 960px) {
    .planning-card__media {
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }
    
    .planning-card__image,
    .planning-card__placeholder {
        height: 100%;
    }
}

@media (max-width: 640px) {
    .card {
        padding: 16px;
    }
    
    .planning-card {
        padding: 14px;
    }
    
    .planning-card__meta,
    .post-card__meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .planning-filters input[type="search"] {
        min-width: 220px;
        flex: 1 1 50px !important;
    }
}

/* ===================================
   7. SPACING & MARGES
   =================================== */

@media (max-width: 640px) {
    .wrap {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    main {
        padding-left: 12px;
        padding-right: 12px;
        margin-top: 16px;
    }
    
    .layout {
        gap: 16px;
    }
}

/* ===================================
   8. SOUS-MENUS TACTILES
   =================================== */

@media (max-width: 960px) {
    .submenu {
        position: static;
        display: none;
        background: rgba(0, 0, 0, 0.2);
        border: none;
        border-radius: 6px;
        margin-top: 8px;
        padding: 8px;
    }
    
    .submenu.is-open {
        display: block;
    }
    
    .submenu a {
        padding: 10px 12px;
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .has-submenu > a::after {
        content: '▼';
        margin-left: auto;
        font-size: 12px;
        transition: transform 0.3s ease;
    }
    
    .has-submenu.is-open > a::after {
        transform: rotate(180deg);
    }
}

/* ===================================
   9. IMAGES & MÉDIAS
   =================================== */

@media (max-width: 640px) {
    .thumb {
        width: 100px;
        height: 75px;
    }
    
    .post-featured__image {
        border-radius: 6px;
    }
    
    .pdf-preview__iframe {
        height: 400px;
    }
}

/* ===================================
   10. SIDEBAR
   =================================== */

@media (max-width: 960px) {
    .aside {
        order: 2;
        width: 100%;
    }
    
    .sidebar-card {
        margin-bottom: 16px;
    }
}

/* ===================================
   11. TABLEAUX & OVERFLOW
   =================================== */

@media (max-width: 640px) {
    .meta span {
        font-size: 14px;
        word-break: break-word;
    }
    
    .eq-name {
        max-width: 150px;
    }
}

/* ===================================
   12. MODAL & OVERLAYS
   =================================== */

@media (max-width: 640px) {
    .modal {
        width: 95%;
        max-width: none;
        padding: 16px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn,
    .modal-actions .btn-outline {
        width: 100%;
    }
}

/* ===================================
   13. PAGINATION
   =================================== */

@media (max-width: 640px) {
    .pagination {
        justify-content: center;
    }
    
    .pagination a,
    .pagination span {
        min-width: 44px;
        min-height: 44px;
    }
}

/* ===================================
   14. UTILITAIRES MOBILE
   =================================== */

.hide-mobile {
    display: none !important;
}

.show-mobile {
    display: block !important;
}

@media (min-width: 769px) {
    .hide-mobile {
        display: block !important;
    }
    
    .show-mobile {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .text-center-mobile {
        text-align: center;
    }
    
    .stack-mobile {
        flex-direction: column !important;
        align-items: stretch !important;
    }
}

/* ===================================
   15. REDESIGN HEADER MOBILE
   =================================== */

/* Réorganisation du header : photo + "Bonjour..." à droite */
.member-greeting--redesign {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
    justify-content: flex-end !important;
}

.member-greeting--redesign .member-greeting__avatar {
    order: 2;
}

.member-greeting--redesign .member-greeting__text {
    order: 1;
    white-space: nowrap;
    font-size: 14px;
}

@media (max-width: 640px) {
    .member-greeting--redesign .member-greeting__text {
        font-size: 13px;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Menu hamburger toujours à gauche */
.menu-toggle--left {
    margin-right: auto !important;
    margin-left: 0 !important;
}

/* Layout de la navigation avec hamburger à gauche */
@media (max-width: 960px) {
    .main-nav {
        display: flex;
        flex-direction: row;
        align-items: center;
        width: 100%;
        min-height: 50px;
    }
}
