/* Onglets administration */
.admin-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}
.admin-tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.admin-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}
.admin-tab-btn:hover:not(.active) {
    color: var(--color-text);
    background: var(--color-bg-alt);
}

/* Cartes des forfaits (administration) */
.plan-admin-card {
    background: var(--color-card-bg);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    transition: transform 0.1s;
}
.plan-admin-card:hover {
    transform: translateX(4px);
}
.plan-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}
.plan-admin-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}
.plan-admin-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}
.plan-admin-actions button {
    padding: 0.3rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.plan-admin-actions .btn-secondary-custom {
    background: #f1f5f9;
    color: #1e293b;
    border: none;
}
.plan-admin-actions .btn-secondary-custom:hover {
    background: #e2e8f0;
}
.plan-admin-actions .btn-danger-custom {
    background: #fee2e2;
    color: #ef4444;
    border: none;
}
.plan-admin-actions .btn-danger-custom:hover {
    background: #fecaca;
}

/* ========== MODALES (récupérées de l'ancienne sauvegarde) ========== */

/* Modale événement / groupe */
.modal-custom {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-custom-content {
    background: var(--color-card-bg);
    border-radius: 1.2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    animation: modalFadeIn 0.2s ease-out;
    border: 1px solid rgba(255,255,255,0.2);
}
.modal-custom-header {
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    padding: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}
.modal-custom-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.modal-custom-body label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-light);
    margin-top: 0.2rem;
}
.modal-custom-body input,
.modal-custom-body textarea,
.modal-custom-body select {
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.8rem;
    border: 1px solid var(--color-border);
    font-family: inherit;
    font-size: 0.85rem;
    background: white;
}
.modal-custom-body input:focus,
.modal-custom-body textarea:focus,
.modal-custom-body select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}
.modal-custom-footer {
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    background: #fefefe;
}

/* Boutons personnalisés */
.btn-primary-custom {
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0.4rem 1.2rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
.btn-primary-custom:hover {
    background: var(--color-primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(67, 97, 238, 0.3);
}
.btn-secondary-custom {
    background: #e2e8f0;
    color: var(--color-text);
    border: none;
    border-radius: 2rem;
    padding: 0.4rem 1.2rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}
.btn-secondary-custom:hover {
    background: #cbd5e1;
    transform: translateY(-1px);
}
.btn-danger-custom {
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    transition: var(--transition);
}
.btn-danger-custom:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.3);
}

/* Animation d’entrée */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Popup d'actions pour un événement */
.event-popup {
    position: fixed;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 280px;
    padding: 12px;
    z-index: 100000;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
}
.event-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.event-popup .popup-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #94a3b8;
}
.event-popup .popup-time,
.event-popup .popup-group,
.event-popup .popup-recurring,
.event-popup .popup-description {
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
}
.event-popup .popup-cancelled {
    color: #b91c1c;
    background: #fee2e2;
    padding: 4px 8px;
    border-radius: 8px;
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.event-popup .popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}
.popup-btn {
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
}
.popup-btn.edit {
    background: #eef2ff;
    color: #3b82f6;
}
.popup-btn.delete {
    background: #fee2e2;
    color: #ef4444;
}
.popup-btn.notify {
    background: #dbeafe;
    color: #2563eb;
}
.popup-btn:hover {
    transform: scale(0.98);
}

/* Modale événement / groupe */
.modal-custom {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-custom-content {
    background: var(--color-card-bg);
    border-radius: 1.2rem;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.modal-custom-header {
    background: #f8fafc;
    padding: 1rem;
    font-weight: 600;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text);
}
.modal-custom-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}
.modal-custom-body label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text-light);
    margin-top: 0.2rem;
}
.modal-custom-body input,
.modal-custom-body textarea,
.modal-custom-body select {
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.8rem;
    border: 1px solid var(--color-border);
    font-family: inherit;
    font-size: 0.85rem;
    background: white;
}
.modal-custom-body input:focus,
.modal-custom-body textarea:focus,
.modal-custom-body select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}
.modal-custom-footer {
    padding: 0.8rem 1rem;
    border-top: 1px solid var(--color-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    background: #fefefe;
}
.btn-primary-custom {
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0.4rem 1.2rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}
.btn-primary-custom:hover {
    background: var(--color-primary-dark);
    transform: scale(1.02);
}
.btn-secondary-custom {
    background: #e2e8f0;
    color: var(--color-text);
    border: none;
    border-radius: 2rem;
    padding: 0.4rem 1.2rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}
.btn-secondary-custom:hover {
    background: #cbd5e1;
}
.btn-danger-custom {
    background: var(--color-danger);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    transition: var(--transition);
}
.btn-danger-custom:hover {
    background: #dc2626;
}

/* Listes (événements, groupes, invitations) */
.events-list-page { padding: 1rem; }
.event-card, .group-card {
    background: #f8fafc;
    border-radius: 0.8rem;
    padding: 0.6rem;
    margin-bottom: 0.6rem;
    border-left: 4px solid var(--color-primary);
    font-size: 0.8rem;
}
.group-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.group-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}
.members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}
.member-badge {
    background: #f1f5f9;
    border-radius: 2rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.group-actions {
    display: flex;
    gap: 0.5rem;
}
.btn-edit-group, .btn-delete-group {
    border: none;
    border-radius: 2rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    cursor: pointer;
}
.btn-edit-group {
    background: #e0e7ff;
    color: #1e40af;
}
.btn-delete-group {
    background: #fee2e2;
    color: #991b1b;
}
.invite-card {
    background: var(--color-card-bg);
    border-radius: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
    overflow: hidden;
}
.invite-card:hover {
    box-shadow: var(--shadow-md);
}
.invite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem;
    background: var(--color-bg-page);
    cursor: pointer;
    transition: background 0.2s;
    font-size: 0.9rem;
}
.invite-header:hover {
    background: #eef2ff;
}
.invite-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.invite-title strong {
    font-size: 0.95rem;
    font-weight: 600;
}
.toggle-icon {
    font-size: 1.1rem;
    transition: transform 0.2s;
}
.invite-details {
    padding: 0.8rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.85rem;
    line-height: 1.4;
    background: var(--color-card-bg);
}
.invite-details div {
    margin-bottom: 0.3rem;
}
.invite-details i {
    margin-right: 0.3rem;
}
.invite-actions {
    margin-top: 0.8rem;
    display: flex;
    gap: 0.5rem;
}
.invite-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}
.invite-badge i {
    margin-right: 0.2rem;
    font-size: 0.65rem;
}
.pending-badge {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}
.accepted-badge {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}
.declined-badge {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.btn-accept, .btn-decline {
    border: none;
    border-radius: 2rem;
    padding: 0.25rem 0.8rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
}
.btn-accept {
    background: #d1fae5;
    color: #065f46;
}
.btn-accept:hover {
    background: #a7f3d0;
}
.btn-decline {
    background: #fee2e2;
    color: #991b1b;
}
.btn-decline:hover {
    background: #fecaca;
}
.member-statuses {
    margin-top: 0.5rem;
}
.statuses-toggle {
    cursor: pointer;
    color: var(--color-primary);
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.statuses-list {
    margin-top: 0.5rem;
    background: #ffffff;
    border-radius: 0.8rem;
    border: 1px solid var(--color-border);
    padding: 0.5rem;
}
.member-status-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.75rem;
}
.member-status-item:last-child {
    border-bottom: none;
}
.member-email {
    word-break: break-word;
}
.member-status {
    text-align: right;
    white-space: nowrap;
}
.member-status i {
    margin-right: 0.2rem;
}
.response-date, .response-reason {
    grid-column: span 2;
    margin-top: 0.2rem;
    margin-bottom: 0.2rem;
    font-size: 0.7rem;
}
.pagination-controls {
    display: flex;
    justify-content: center;
    gap: 0.8rem;
    margin-top: 1rem;
}
.pagination-btn {
    background: var(--color-bg-page);
    border: 1px solid var(--color-border);
    border-radius: 2rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.75rem;
    cursor: pointer;
}
.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.page-info {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
}
.settings-container {
    padding: 1rem;
}
.stat-card {
    background: #f1f5f9;
    border-radius: 0.8rem;
    padding: 0.6rem;
    margin-bottom: 0.6rem;
}
/* ========== AMÉLIORATIONS MODERNES - COMPOSANTS ========== */

/* Modale : animation et ombre */
.modal-custom {
    backdrop-filter: blur(6px);
    transition: backdrop-filter 0.2s;
}
.modal-custom-content {
    animation: modalFadeIn 0.2s ease-out;
    border: 1px solid rgba(255,255,255,0.2);
}
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
.modal-custom-header {
    background: linear-gradient(135deg, #f8fafc, #ffffff);
    font-size: 1.2rem;
}
.modal-custom-footer {
    background: #fefefe;
}

/* Boutons de la modale */
.btn-primary-custom, .btn-secondary-custom, .btn-danger-custom {
    transition: all 0.15s;
    box-shadow: 0 1px 1px rgba(0,0,0,0.05);
}
.btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(67, 97, 238, 0.3);
}
.btn-secondary-custom:hover {
    background: #cbd5e1;
    transform: translateY(-1px);
}
.btn-danger-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(239, 68, 68, 0.3);
}

/* Cartes d'événements et groupes */
.event-card, .group-card, .invite-card {
    transition: transform 0.15s, box-shadow 0.15s;
}
.event-card:hover, .group-card:hover, .invite-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Badges de membres */
.member-badge {
    transition: all 0.1s;
}
.member-badge:hover {
    background: #e2e8f0;
    transform: scale(1.02);
}

/* Pagination */
.pagination-btn {
    transition: all 0.15s;
}
.pagination-btn:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    transform: translateY(-1px);
}
/* ========== AMÉLIORATIONS MODALES, CARTES, LISTES ========== */

/* Modale : animation et ombre */
.modal-custom-content {
    animation: fadeInUp 0.2s ease;
    border-radius: 1.5rem;
}
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.modal-custom-header {
    background: linear-gradient(135deg, #f8fafc, #ffffff);
}
.modal-custom-footer {
    background: #f8fafc;
}

/* Cartes événements / groupes */
.event-card, .group-card {
    transition: transform 0.1s, box-shadow 0.2s;
    border-left-width: 4px;
}
.event-card:hover, .group-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}
.group-card-header .group-name {
    font-size: 1rem;
}
.btn-edit-group, .btn-delete-group {
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    transition: all 0.1s;
}
.btn-edit-group:active, .btn-delete-group:active {
    transform: scale(0.96);
}

/* Invitations */
.invite-header {
    border-radius: 1rem;
}
.invite-header .invite-title strong {
    color: var(--color-text);
}
.invite-badge {
    font-weight: 700;
    padding: 0.2rem 0.7rem;
}
.btn-accept, .btn-decline {
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.1s;
}
.btn-accept:active, .btn-decline:active {
    transform: scale(0.96);
}

/* Membres */
.member-badge {
    background: #eef2ff;
    color: var(--color-primary-dark);
}
.statuses-toggle {
    font-weight: 500;
}
.statuses-toggle:hover {
    text-decoration: underline;
}
.member-status-item {
    border-left: 2px solid transparent;
    transition: background 0.1s;
}
.member-status-item:hover {
    background: #f8fafc;
    border-left-color: var(--color-primary);
}
/* ========== BOUTONS DE SUPPRESSION (croix) - VERSION CORRIGÉE ========== */

/* Pour la vue mois (déjà ok avec flex) */
.event-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.delete-event-btn {
    background: rgba(0, 0, 0, 0.08);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    color: #6b7280;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}
.delete-event-btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
}

/* Pour la vue semaine/jour – réservation d'espace */
.timeline-event {
    position: absolute;
    padding: 4px 24px 4px 6px !important;  /* espace à droite pour la croix */
    box-sizing: border-box;
    overflow: visible;
}
.delete-event-timeline {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 4px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    z-index: 15;
}
.delete-event-timeline:hover {
    background: #ef4444;
    transform: translateY(-50%) scale(1.1);
}

/* Pour la vue jour (identique à semaine) */
.timeline-day-col .timeline-event {
    padding: 4px 24px 4px 6px !important;
}

/* Onglets invitations */
.invitations-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}
.inv-tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    color: var(--color-text-light);
    transition: all 0.2s;
}
.inv-tab-btn.active {
    color: var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
}
.inv-tab-btn:hover:not(.active) {
    color: var(--color-text);
}
.inv-panel {
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.badge.received-count, .badge.sent-count {
    background-color: #ef4444;
    color: white;
    border-radius: 20px;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: auto;
}

/* Harmonisation des cartes d'invitation avec les cartes de groupe */
.invite-card {
    background: #f8fafc;
    border-radius: 0.8rem;
    margin-bottom: 0.6rem;
    border-left: 4px solid var(--color-primary);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.invite-card:hover {
    box-shadow: var(--shadow-sm);
}
.invite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    background: var(--color-bg-page);
}
.invite-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.invite-title strong {
    font-size: 0.9rem;
}
.invite-details {
    padding: 0.6rem 0.8rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.8rem;
    background: white;
}
.invite-actions {
    margin-top: 0.6rem;
    display: flex;
    gap: 0.5rem;
}
/* Conservation des badges existants */
.invite-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 2rem;
    font-size: 0.7rem;
    font-weight: 600;
}
/* ========== HARMONISATION INVITATIONS / GROUPES ========== */

/* ========== CARTES INVITATIONS - STYLE IDENTIQUE AUX GROUPES ========== */

/* ========== CARTES INVITATIONS - STYLE CORRIGÉ ========== */

.invite-card {
    background: white;
    border-radius: 12px;
    margin-bottom: 12px;
    border-left: 4px solid var(--color-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* En-tête - chaque élément sur sa propre ligne */
.invite-header {
    padding: 12px 16px;
    background: #f8fafc;
    cursor: pointer;
    position: relative;
}
.invite-header:hover {
    background: #f1f5f9;
}

/* Ligne titre + badges - en haut */
.invite-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    padding-right: 30px;
}
.invite-title-row strong {
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Groupe - sur sa propre ligne */
.invite-group-line {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: #475569;
}
.invite-group-line i {
    margin-right: 6px;
    color: var(--color-primary);
}

/* Dates - sur sa propre ligne */
.invite-dates-line {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
}
.invite-dates-line i {
    margin-right: 6px;
    color: var(--color-primary);
}

/* Icône accordéon - plus visible */
.toggle-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 1.1rem;
    color: var(--color-primary);
    background: rgba(67, 97, 238, 0.1);
    padding: 4px 6px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}
.toggle-icon:hover {
    background: var(--color-primary);
    color: white;
}

/* Détails repliables */
.invite-details {
    padding: 12px 16px;
    background: white;
    border-top: 1px solid #e9ecef;
    font-size: 0.8rem;
}

/* Suppression du titre en double dans les détails */
.invite-details .event-title-duplicate {
    display: none;
}

/* Lignes séparées dans l'en-tête */
.invite-group-line {
    display: block;
    margin-bottom: 6px;
    font-size: 0.8rem;
    color: #475569;
}
.invite-group-line i {
    margin-right: 6px;
    color: var(--color-primary);
}
.invite-dates-line {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
}
.invite-dates-line i {
    margin-right: 6px;
    color: var(--color-primary);
}

/* Icône accordéon visible */
.toggle-icon {
    float: right;
    font-size: 1.1rem;
    color: var(--color-primary);
    background: rgba(67, 97, 238, 0.1);
    padding: 4px 6px;
    border-radius: 20px;
    cursor: pointer;
    margin-top: -36px;
}
.toggle-icon:hover {
    background: var(--color-primary);
    color: white;
}

/* FORCE LES INVITATIONS EN LIGNES SÉPARÉES - À METTRE À LA FIN */
.invite-card .invite-header {
    display: block !important;
    padding-bottom: 10px !important;
}
.invite-card .invite-title-row {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 10px !important;
}
.invite-card .invite-group-line {
    display: block !important;
    margin-bottom: 6px !important;
}
.invite-card .invite-dates-line {
    display: block !important;
    margin-bottom: 4px !important;
}
.invite-card .toggle-icon {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    float: none !important;
    margin-top: 0 !important;
}

.member-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 0 6px 6px 0;
}
.remove-member-btn {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    opacity: 0.6;
    transition: opacity 0.1s;
}
.remove-member-btn:hover {
    opacity: 1;
}

/* Champ emails multiple */
#newMemberEmail {
    font-family: monospace;
    font-size: 0.85rem;
    background: #f8fafc;
    border: 1px solid var(--color-border);
    border-radius: 0.8rem;
    padding: 0.6rem;
}

#newMemberEmail:focus {
    background: white;
    border-color: var(--color-primary);
    outline: none;
}

/* Style pour l'expéditeur dans les invitations */
.invite-from .member-badge {
    background: #f1f5f9;
    border-radius: 2rem;
    padding: 0.2rem 0.6rem;
    font-size: 0.7rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--color-text);
}

/* Bouton Transférer amélioré */
.btn-transfer {
    background: #f0f4fe;
    color: #3b82f6;
    border: none;
    border-radius: 2rem;
    padding: 0.25rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-transfer i {
    font-size: 0.8rem;
}
.btn-transfer:hover {
    background: #e0e7ff;
    transform: translateY(-1px);
}
.btn-transfer:active {
    transform: translateY(1px);
}

.decline-reason {
    display: block;
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
    font-style: italic;
}

/* Pour la ligne contenant email + statut */
.member-status-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.member-email {
    font-size: 0.9rem;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* Raison du refus, seconde ligne */
.decline-reason-line {
    margin-top: 0.3rem;
    padding-top: 0.3rem;
    border-top: 1px dashed #e5e7eb;
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

.decline-reason-line i {
    margin-right: 0.3rem;
    font-size: 0.75rem;
}

.member-status-item {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.member-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.member-email {
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.85rem;
}

.status-badge.accepted i { color: #10b981; }
.status-badge.declined i { color: #ef4444; }
.status-badge.pending i { color: #f59e0b; }

.decline-reason {
    margin-top: 6px;
    padding-left: 24px;
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.decline-reason i {
    font-size: 0.75rem;
    color: #ef4444;
}

.timeline-event:hover .delete-event-timeline {
    opacity: 1 !important;
}

.delete-event-timeline {
    position: relative;
    z-index: 1060 !important; /* valeur supérieure à celle du tooltip */
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 2px 4px;
    color: #ef4444;
    font-weight: bold;
    cursor: pointer;
}

.delete-event-timeline {
    position: relative !important;
    z-index: 2000 !important;
    background: white !important;
    border-radius: 12px !important;
    padding: 2px 6px !important;
    margin-left: 8px !important;
}

.btn-activate-group {
    background: #10b981;  /* vert moderne */
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-activate-group:hover {
    background: #059669;
    transform: translateY(-1px);
}
.btn-activate-group i {
    font-size: 0.9rem;
}

#groupActivationError {
    font-family: system-ui;
    font-weight: 500;
}

.former-member {
    text-decoration: line-through;
    color: #9ca3af;
}
.member-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}
.remove-former-member-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444;
    font-size: 1rem;
}

.members-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.member-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.btn-leave-group {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 0.5rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-leave-group:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Onglets pour les groupes */
.groups-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}
.groups-tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}
.groups-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}
.tab-count {
    background: var(--color-bg-alt);
    border-radius: 20px;
    padding: 0.1rem 0.5rem;
    font-size: 0.7rem;
    margin-left: 0.4rem;
}

/* Style des onglets (réutilisable) */
.invitations-tabs,
.groups-tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

.invitations-tab-btn,
.groups-tab-btn {
    background: none;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.invitations-tab-btn.active,
.groups-tab-btn.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.tab-count {
    background: var(--color-bg-alt);
    border-radius: 20px;
    padding: 0.1rem 0.5rem;
    font-size: 0.7rem;
    margin-left: 0.4rem;
}


/* Réduire la taille de la police pour les statuts des membres */
.member-status-item .member-email,
.member-status-item .status-badge,
.member-status-item .decline-reason {
    font-size: 0.7rem;
}

/* Liste des événements à venir */
.events-list-container {
    padding: 1rem;
}

.events-list-container h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.event-card {
    background: white;
    border-radius: 1rem;
    border-left: 4px solid;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 1rem;
    transition: transform 0.1s;
}

.event-card:hover {
    transform: translateX(4px);
}

.event-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.event-title {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 1rem;
}

.event-date-badge {
    background: #f1f5f9;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
    color: #1e293b;
}

.event-time {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-top: 0.3rem;
}

.event-description {
    font-size: 0.75rem;
    color: #475569;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #eef2f6;
}

.events-empty {
    text-align: center;
    padding: 3rem;
    color: #64748b;
}

.events-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* Boutons d’action dans les invitations envoyées */
.event-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.btn-archive-event,
.btn-delete-event-invitations {
    background: #f1f5f9;
    border: none;
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-archive-event:hover,
.btn-delete-event-invitations:hover {
    transform: translateY(-1px);
}

.btn-archive-event {
    color: #3b82f6;
    background: #eff6ff;
}

.btn-archive-event:hover {
    background: #dbeafe;
}

.btn-delete-event-invitations {
    color: #ef4444;
    background: #fef2f2;
}

.btn-delete-event-invitations:hover {
    background: #fee2e2;
}

/* Alignement avec la ligne des dates */
.recurrence-info {
    font-size: 0.8rem;
    color: #64748b;  /* ou var(--color-text-light) */
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.recurrence-info i {
    font-size: 0.8rem;
}

.event-popup {
    position: absolute;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    width: 260px;
    padding: 12px;
    z-index: 10000;
    font-size: 0.85rem;
    border: 1px solid #e2e8f0;
}
.event-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.event-popup .popup-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #94a3b8;
}
.event-popup .popup-time, .event-popup .popup-group {
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
}
.event-popup .popup-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: flex-end;
}
.popup-btn {
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
}
.popup-btn.edit {
    background: #eef2ff;
    color: #3b82f6;
}
.popup-btn.delete {
    background: #fee2e2;
    color: #ef4444;
}
.popup-btn:hover {
    transform: scale(0.98);
}

.event-popup .popup-cancelled,
.event-popup .popup-recurring,
.event-popup .popup-group,
.event-popup .popup-description {
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 6px;
    color: #475569;
    font-size: 0.8rem;
}
.event-popup .popup-cancelled {
    color: #b91c1c;
    background: #fee2e2;
    padding: 4px 8px;
    border-radius: 8px;
}

.notifications-toggle {
    cursor: pointer;
    margin-top: 10px;
    padding: 6px;
    background: #f8fafc;
    border-radius: 8px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.notifications-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
}
.notifications-table th, .notifications-table td {
    padding: 6px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

/* Notifications dans la page Événements */
.notifications-section {
    margin-top: 0.75rem;
}
.notifications-toggle {
    cursor: pointer;
    padding: 0.3rem 0.6rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: background 0.2s;
}
.notifications-toggle:hover {
    background: #eef2ff;
}
.notifications-list {
    margin-top: 0.5rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    overflow-x: auto;
}
.notifications-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}
.notifications-table th,
.notifications-table td {
    padding: 8px 10px;
    text-align: left;
    border-bottom: 1px solid #eef2f6;
}
.notifications-table th {
    background: #f8fafc;
    font-weight: 600;
}

.notifications-table tr:hover {
    background: #f9fafb;
}

/* ========== FILTRES ÉVÉNEMENTS ========== */
.events-filters {
    background: var(--color-card-bg);
    padding: 1.2rem 1rem;
    border-radius: 1rem;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    border: 1px solid var(--color-border);
}

.events-filters > div {
    flex: 1 1 auto;
    min-width: 130px;
}

.events-filters label {
    display: block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-light);
    margin-bottom: 0.3rem;
}

.events-filters .form-control {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.8rem;
    border: 1px solid var(--color-border);
    background: var(--color-bg);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.events-filters .form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(59,130,246,0.2);
    outline: none;
}

.events-filters button {
    padding: 0.5rem 1.2rem;
    border-radius: 2rem;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: #f1f5f9;
    color: #1e293b;
}

.events-filters .btn-primary-custom {
    background: linear-gradient(135deg, var(--color-primary), #2563eb);
    color: white;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.events-filters .btn-primary-custom:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
}

.events-filters .btn-secondary-custom {
    background: #f1f5f9;
    color: #475569;
}

.events-filters .btn-secondary-custom:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Responsive : les champs prennent toute la largeur sur petit écran */
@media (max-width: 768px) {
    .events-filters > div {
        flex: 1 1 100%;
        min-width: auto;
    }
    .events-filters {
        flex-direction: column;
        align-items: stretch;
    }
}

.event-card.cancelled {
    opacity: 0.6;
    background: #fef2f2;
}
.event-cancel-message {
    font-size: 0.7rem;
    color: #b91c1c;
    margin-top: 0.3rem;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.group-creation-date {
    font-size: 0.7rem;
    color: #64748b;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-copy-group {
    background: #f1f5f9;
    color: #1e293b;
    border: none;
    border-radius: 0.5rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-copy-group:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.btn-transfer-ownership {
    background: #fef9c3;
    color: #854d0e;
    border: none;
    border-radius: 0.5rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-transfer-ownership:hover {
    background: #fde047;
    transform: translateY(-1px);
}

/* Bouton "Événement" dans les cartes groupe – harmonisé avec les autres */
.btn-create-event-group {
    background: #e0e7ff;
    color: #1e40af;
    border: none;
    border-radius: 0.5rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.btn-create-event-group:hover {
    background: #c7d2fe;
    transform: translateY(-1px);
}

.btn-chat-group{
    background: #e0e7ff;
    color: #1e40af;
    border: none;
    border-radius: 0.5rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-chat-group:hover {
    background: #c7d2fe;
    transform: translateY(-1px);
}

.btn-group-events{
    background: #e0e7ff;
    color: #1e40af;
    border: none;
    border-radius: 0.5rem;
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.btn-group-events:hover {
    background: #c7d2fe;
    transform: translateY(-1px);
}

/* ========== STYLES DU CHAT ========== */
.chat-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: white;
    font-size: 0.9rem;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.chat-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
}
.back-to-groups-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #3b82f6;
}
.chat-close-btn, .chat-back-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-threads-container, .chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.thread-item {
    background: #f8fafc;
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom: 0.8rem;
    border-left: 4px solid #3b82f6;
}
.thread-title {
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.thread-meta {
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}
.thread-actions button {
    margin-right: 0.5rem;
    font-size: 0.7rem;
    background: #e2e8f0;
    border: none;
    border-radius: 0.3rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
}
.thread-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.3rem;
    border-radius: 1rem;
    background: #cbd5e1;
    margin-left: 0.5rem;
}
.thread-badge.closed { background: #ef4444; color: white; }
.thread-badge.archived { background: #f59e0b; color: white; }

.message-item {
    margin-bottom: 1rem;
    display: flex;
}
.message-bubble {
    max-width: 80%;
    padding: 0.6rem 1rem;
    border-radius: 1rem;
    background: #f1f5f9;
}
.message-own {
    justify-content: flex-end;
}
.message-own .message-bubble {
    background: #e0e7ff;
}
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
}
.message-actions {
    display: none;
    gap: 0.3rem;
}
.message-item:hover .message-actions {
    display: flex;
}
.message-actions button {
    background: none;
    border: none;
    cursor: pointer;
}
.message-edited {
    font-size: 0.6rem;
    color: #94a3b8;
    margin-top: 0.2rem;
}
.deleted-by-admin {
    color: #dc2626;
    font-style: italic;
}
.chat-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.8rem;
    border-top: 1px solid #e2e8f0;
    background: white;
}
.chat-input-area textarea {
    flex: 1;
    resize: vertical;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    padding: 0.5rem;
}
.chat-empty, .chat-closed-info, .chat-cannot-post {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}
.chat-new-thread {
    margin-top: 1rem;
    text-align: center;
}


/* Panneau de discussion (remplacement complet) */
.groups-panel {
    display: block;
}
.chat-panel {
    display: none;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 500px;
    box-shadow: var(--shadow-sm);
}

/* Styles du chat (tels que fournis précédemment) */
.chat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}
.chat-header h3 {
    flex: 1;
    margin: 0;
    font-size: 1.1rem;
}
.back-to-groups-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 500;
    color: #3b82f6;
}
/* ... tous les autres styles pour threads, messages, etc. (voir message précédent) */

/* ========== LISTE DES THREADS (discussions) ========== */
.threads-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.thread-item {
    background: white;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    border-left: 4px solid #3b82f6;
    transition: all 0.2s ease;
}

.thread-item:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.thread-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.thread-meta {
    font-size: 0.7rem;
    color: #6c757d;
    margin-bottom: 0.8rem;
}

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

.thread-actions button {
    background: #f1f5f9;
    border: none;
    border-radius: 2rem;
    padding: 0.2rem 0.8rem;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.thread-actions button:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

.thread-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    border-radius: 1rem;
    background: #e2e8f0;
    margin-left: 0.5rem;
    font-weight: normal;
}
.thread-badge.closed {
    background: #fee2e2;
    color: #b91c1c;
}
.thread-badge.archived {
    background: #fef3c7;
    color: #b45309;
}

/* Bouton nouveau sujet */
.chat-new-thread {
    margin-top: 1rem;
    text-align: center;
}
#newThreadBtn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
#newThreadBtn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}
.chat-input-area {
    display: flex !important;
}

.popup-cancelled {
    margin-top: 8px;
    padding: 6px;
    background-color: #f8d7da;
    border-left: 3px solid #dc3545;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #721c24;
    display: flex;
    align-items: center;
    gap: 6px;
}

.popup-cancelled i {
    font-size: 1rem;
}

/* Conteneur des actions */
.popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
    justify-content: flex-start;
    border-top: 1px solid #e9ecef;
    padding-top: 12px;
}

/* Style de base pour tous les boutons */
.popup-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 40px;          /* forme capsule moderne */
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f1f3f5;
    color: #1e293b;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.popup-btn i {
    font-size: 1rem;
}

/* Effet au survol */
.popup-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    background-color: #e9ecef;
}

.popup-btn:active {
    transform: translateY(0);
}

/* Bouton Supprimer / Retirer (danger) */
.popup-btn.delete {
    background: linear-gradient(135deg, #fee2e2 0%, #ffc9c9 100%);
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.popup-btn.delete:hover {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: #991b1b;
}

/* Bouton Annuler (pour admin) – orange/rouge doux */
.popup-btn.cancel {
    background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.popup-btn.cancel:hover {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #7c2d12;
}

/* Bouton Replanifier / Éditer (neutre / bleu) */
.popup-btn.edit {
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    color: #0369a1;
    border: 1px solid #bae6fd;
}

.popup-btn.edit:hover {
    background: linear-gradient(135deg, #bae6fd 0%, #7dd3fc 100%);
    color: #0c4a6e;
}

/* Bouton Notifier (vert / info) */
.popup-btn.notify {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.popup-btn.notify:hover {
    background: linear-gradient(135deg, #bbf7d0 0%, #86efac 100%);
    color: #14532d;
}

/* Adaptations pour écrans mobiles */
@media (max-width: 600px) {
    .popup-actions {
        gap: 6px;
    }
    .popup-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }
}
/* ===== CORRECTIONS AFFICHAGE DESCRIPTIONS ===== */

/* 1. Dans la vue "Événements partagés - Envoyées" */
.invite-details {
    word-break: break-word;
    white-space: normal;
    overflow: visible !important;
}

.invite-details div {
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Éviter les ellipsis sur la description */
.invite-details .invite-description,
.invite-details .event-description {
    text-overflow: clip;
    white-space: normal !important;
    overflow: visible !important;
    max-height: none !important;
}

/* 2. Dans le modal de popup événement (calendrier) */
.popup-description {
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-height: none !important;
    overflow-y: auto !important;
    margin-top: 8px;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

/* 3. Pour toutes les cartes d'invitation */
.invite-card {
    overflow: visible;
}

/* Style commun pour les badges de compteur dans la sidebar */
.badge.groups-badge,
.badge.received-count {
    background-color: #ef4444 !important;
    color: white !important;
    border-radius: 9999px;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    font-weight: 600;
    min-width: 1.5rem;
    text-align: center;
}
/* Style pour les threads et messages */
.thread-card .group-actions button {
    margin-left: 0.5rem;
}

.thread-status {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.status-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    background-color: #e2e8f0;
    color: #1e293b;
}

.status-badge.closed {
    background-color: #fee2e2;
    color: #dc2626;
}

.status-badge.archived {
    background-color: #fef9c3;
    color: #ca8a04;
}

/* Messages */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
    flex-wrap: wrap;
}

.message-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.message-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    transition: color 0.2s;
}

.message-actions button:hover {
    color: #3b82f6;
}

.message-content {
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-input-area textarea {
    resize: vertical;
}

/* Boutons d’action dans les cartes (Groupes, Threads, Événements) */
.group-actions button,
.thread-actions button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.8rem;
    border-radius: 40px;
    font-size: 0.8rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f1f5f9;
    color: #1e293b;
}

.group-actions button:hover,
.thread-actions button:hover {
    background-color: #e2e8f0;
    transform: translateY(-1px);
}

/* Bouton "Consulter" (voir) */
.thread-open-btn {
    background-color: #e0f2fe !important;
    color: #0369a1 !important;
}
.thread-open-btn:hover {
    background-color: #bae6fd !important;
}

/* Bouton "Fermer" / "Rouvrir" */
.thread-close-btn {
    background-color: #fee2e2 !important;
    color: #b91c1c !important;
}
.thread-close-btn:hover {
    background-color: #fecaca !important;
}

/* Bouton "Archiver" / "Désarchiver" */
.thread-archive-btn {
    background-color: #fef9c3 !important;
    color: #854d0e !important;
}
.thread-archive-btn:hover {
    background-color: #fde047 !important;
}

/* Bouton "Supprimer" */
.thread-delete-btn {
    background-color: #fee2e2 !important;
    color: #dc2626 !important;
}
.thread-delete-btn:hover {
    background-color: #fecaca !important;
}

/* Titres de section avec icônes */
.group-card-header .group-name i,
.thread-card .group-name i {
    margin-right: 0.5rem;
    font-size: 1.2rem;
}

/* Conteneur des messages */
.messages-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Carte message commune */
.message-card {
    max-width: 70%;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.1s ease;
}

/* Message envoyé par l'utilisateur courant (aligné à droite) */
.message-own {
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}

/* Message reçu (aligné à gauche) */
.message-other {
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}

/* En-tête du message */
.message-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8rem;
    color: #475569;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
}

.message-actions {
    margin-left: auto;
    display: flex;
    gap: 0.5rem;
}

.message-actions button {
    background: none;
    border: none;
    cursor: pointer;
    color: #94a3b8;
    padding: 0.2rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

.message-actions button:hover {
    color: #3b82f6;
    background-color: rgba(59,130,246,0.1);
}

/* Contenu du message */
.message-content {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.4;
}
/* Vue thread */
.thread-view {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 140px); /* Ajustez selon votre layout */
    min-height: 400px;
}

/* En-tête sticky */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.header-center h2 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-right .btn-sm {
    background: #f1f5f9;
    border: none;
    border-radius: 2rem;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: all 0.2s;
}
.header-right .btn-sm:hover {
    background: #e2e8f0;
}

/* Conteneur des messages avec défilement */
.messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background-color: #f8fafc;
}

/* Carte message (inchangé, déjà défini) */
.message-card {
    max-width: 70%;
    border-radius: 1rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}
.message-own {
    align-self: flex-end;
    border-bottom-right-radius: 0.25rem;
}
.message-other {
    align-self: flex-start;
    border-bottom-left-radius: 0.25rem;
}

/* Zone de saisie fixe en bas */
.chat-input-area {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
    padding: 0.75rem 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}
.chat-input-area textarea {
    flex: 1;
    resize: vertical;
}
.chat-input-area button {
    height: 42px;
    align-self: flex-end;
}

/* Bannière info */
.info-banner {
    background: #fef9c3;
    color: #854d0e;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.85rem;
    border-top: 1px solid #e2e8f0;
}


/* Messages – taille réduite */
.message-content {
    font-size: 0.9rem;
    line-height: 1.4;
}

.message-header {
    font-size: 0.75rem;
}

/* ========== BOUTONS MODERNES : NOUVEAU GROUPE, NOUVELLE DISCUSSION, AJOUTER ========== */

#newGroupBtn,
#newThreadBtn,
#globalAddBtn {
    background: linear-gradient(135deg, #3b82f6, #2563eb) !important;
    color: white !important;
    border: none !important;
    border-radius: 2rem !important;
    padding: 0.6rem 1.4rem !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.6rem !important;
    cursor: pointer !important;
    transition: all 0.25s ease !important;
    box-shadow: 0 4px 6px -2px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
    letter-spacing: 0.3px !important;
}

/* Icônes */
#newGroupBtn i,
#newThreadBtn i,
#globalAddBtn i {
    font-size: 1.1rem !important;
    transition: transform 0.2s ease !important;
}

/* Effet au survol */
#newGroupBtn:hover,
#newThreadBtn:hover,
#globalAddBtn:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 12px 20px -8px rgba(59, 130, 246, 0.4) !important;
}

/* Effet au clic */
#newGroupBtn:active,
#newThreadBtn:active,
#globalAddBtn:active {
    transform: translateY(1px) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Survol de l'icône : léger décalage */
#newGroupBtn:hover i,
#newThreadBtn:hover i,
#globalAddBtn:hover i {
    transform: translateX(2px);
}

/* Version mobile : plus compact */
@media (max-width: 640px) {
    #newGroupBtn,
    #newThreadBtn,
    #globalAddBtn {
        padding: 0.4rem 1rem !important;
        font-size: 0.8rem !important;
        gap: 0.4rem !important;
    }
    #newGroupBtn i,
    #newThreadBtn i,
    #globalAddBtn i {
        font-size: 1rem !important;
    }
}

/* ========== NOTIFICATIONS ========== */
.notification-bell {
    position: relative;
    cursor: pointer;
    margin-right: 1rem;
    font-size: 1.3rem;
    color: #1e293b;
}
.notification-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #ef4444;
    color: white;
    border-radius: 20px;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: bold;
    min-width: 1.2rem;
    text-align: center;
}
.notification-panel {
    position: absolute;
    top: 55px;
    right: 20px;
    width: 340px;
    max-height: 450px;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
}
.notification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    background: #f8fafc;
    border-radius: 1rem 1rem 0 0;
}
.notification-header button {
    background: none;
    border: none;
    color: #3b82f6;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
}
.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
}
.notification-item:hover {
    background: #f8fafc;
}
.notification-item.unread {
    background: #eff6ff;
}
.notification-title {
    font-weight: 600;
    font-size: 0.85rem;
}
.notification-detail {
    font-size: 0.7rem;
    color: #64748b;
    margin-top: 0.25rem;
}
/* Alignement de la cloche avec le menu utilisateur */
.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.notification-bell {
    position: relative;
    font-size: 1.3rem;
    color: #1e293b;
    cursor: pointer;
    display: flex;
    align-items: center;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Ajustement du badge */
.notification-badge {
    position: absolute;
    top: -6px;
    right: -10px;
    background: #ef4444;
    color: white;
    border-radius: 20px;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
    font-weight: bold;
}

/* ========== FIXER L'EN-TÊTE MOBILE ========== */
@media (max-width: 768px) {
    /* Le toolbar-center (vue mobile) reste collé en haut */
    .toolbar-center {
        position: sticky;
        top: 0;
        z-index: 100;
        background: white;
        border-bottom: 1px solid #e2e8f0;
    }

    /* Le titre du jour (mobile-day-header) doit être fixe sous la barre d'outils */
    .mobile-day-header {
        position: sticky;
        top: 48px; /* Hauteur approximative du toolbar-center */
        z-index: 99;
        background: white;
        padding: 0.75rem 1rem;
        font-weight: 600;
        border-bottom: 1px solid #e2e8f0;
        margin: 0;
    }

    /* Réduire le bouton "Ajouter" : seulement l'icône sur mobile */
    #globalAddBtn {
        padding: 0.4rem 0.8rem !important;
        font-size: 0 !important; /* cache le texte */
        gap: 0 !important;
    }
    #globalAddBtn i {
        font-size: 1.2rem !important;
        margin: 0 !important;
    }
    /* Pour les très petits écrans, encore plus compact */
    @media (max-width: 480px) {
        #globalAddBtn {
            padding: 0.3rem 0.6rem !important;
        }
        #globalAddBtn i {
            font-size: 1rem !important;
        }
        .mobile-day-header {
            top: 44px;
        }
    }

    /* Ajuster la timeline pour qu'elle défile sous les en-têtes fixes */
    .mobile-timeline-body {
        padding-top: 0;
    }
    .mobile-hours-column, .mobile-events-column {
        margin-top: 0;
    }
}
/* Structure mobile : colonnes côte à côte */
.mobile-timeline-inner {
    display: flex;
    width: 100%;
}

.mobile-hours-col {
    flex-shrink: 0;
    width: 60px;
    background: #f8fafc;
}

.mobile-events-col {
    flex: 1;
    position: relative;
    background: #ffffff;
}

.mobile-hour {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #64748b;
    border-bottom: 1px solid #e2e8f0;
}

.mobile-slot-line {
    position: absolute;
    left: 0;
    width: 100%;
    border-top: 1px solid #eef2f6;
    pointer-events: none;
}

/* Rendre la barre d'outils fixe sur mobile et le bouton "+" réduit */
@media (max-width: 768px) {
    .toolbar-center {
        position: sticky;
        top: 0;
        z-index: 100;
        background: white;
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }

    #globalAddBtn {
        padding: 0.3rem 0.6rem !important;
        font-size: 0 !important;
        gap: 0 !important;
        min-width: 36px !important;
        flex-shrink: 0;
    }
    #globalAddBtn i {
        font-size: 1.2rem !important;
        margin: 0 !important;
    }

    .mobile-timeline-scroll {
        height: calc(100vh - 60px);
        overflow-y: auto;
    }
}

/* Dropdown menu pour les actions de groupe */
.group-dropdown-menu {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    padding: 0.3rem 0;
    min-width: 150px;
    z-index: 1000;
}
.group-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    width: 100%;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.1s;
}
.group-dropdown-menu .dropdown-item:hover {
    background: #f1f5f9;
}
.group-dropdown-menu .dropdown-item i {
    width: 1.2rem;
}

/* Ajustement pour les boutons de la carte groupe */
.group-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.btn-group-more {
    background: #f1f5f9;
    border: none;
    border-radius: 2rem;
    padding: 0.3rem 0.6rem;
    font-size: 1rem;
    cursor: pointer;
}
.btn-group-more:hover {
    background: #e2e8f0;
}

/* Responsive : le dropdown sur mobile peut s'afficher plus large */
@media (max-width: 640px) {
    .group-dropdown-menu {
        position: fixed !important;
        top: auto !important;
        left: 50% !important;
        transform: translateX(-50%);
        bottom: 20px;
        width: 90%;
        max-width: 280px;
    }
}

/* En-tête de la vue "Événements du groupe" */
.group-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.btn-icon-only {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #475569;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon-only:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

.group-events-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
    color: #1e293b;
    flex-wrap: wrap;
}
.group-events-title i {
    font-size: 1.3rem;
    color: #3b82f6;
}
.group-name-badge {
    background: #f1f5f9;
    padding: 0.2rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: normal;
    color: #475569;
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Version mobile : plus compact */
@media (max-width: 640px) {
    .group-events-header {
        gap: 0.5rem;
    }
    .group-events-title span:first-of-type {
        display: none; /* cache le texte "Événements du groupe" sur mobile */
    }
    .group-name-badge {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
    .btn-sm span {
        display: none; /* cache le texte "Ajouter", ne garde que l'icône */
    }
    .btn-sm {
        padding: 0.4rem 0.6rem;
    }
    .btn-icon-only {
        font-size: 1.2rem;
        padding: 0.3rem;
    }
}

/* En-têtes modernisés */
.group-threads-header,
.thread-messages-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
    flex-wrap: wrap;
}

.group-threads-title,
.thread-messages-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
    font-weight: 500;
    margin: 0;
    color: #1e293b;
    flex-wrap: wrap;
}
.group-threads-title i,
.thread-messages-title i {
    font-size: 1.3rem;
    color: #3b82f6;
}
.group-name-badge {
    background: #f1f5f9;
    padding: 0.2rem 0.8rem;
    border-radius: 2rem;
    font-size: 0.85rem;
    font-weight: normal;
    color: #475569;
}
.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-success-custom {
    background: #10b981;
    color: white;
}
.btn-warning-custom {
    background: #f59e0b;
    color: white;
}
@media (max-width: 640px) {
    .group-threads-header,
    .thread-messages-header {
        gap: 0.5rem;
    }
    .group-threads-title span:first-of-type {
        display: none;
    }
    .btn-sm span {
        display: none;
    }
    .btn-sm {
        padding: 0.4rem 0.6rem;
    }
}

/* Popup mobile : positionné en bas de l'écran, largeur adaptée */


@media (max-width: 768px) {
    .event-popup {
        position: fixed !important;
        bottom: 20px !important;
        left: 20px !important;
        right: 20px !important;
        top: auto !important;
        width: auto !important;
        max-width: none !important;
        border-radius: 1rem !important;
        transform: none !important;
        z-index: 10000;
        box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    }
}


/* Demandes de transfert */
.transfer-requests-section {
    margin-top: 12px;
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
}
.section-title {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.85rem;
}
.transfer-request-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px;
    margin-bottom: 8px;
}
.request-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 4px;
}
.status-pending { color: #f59e0b; }
.status-approved { color: #10b981; }
.status-rejected { color: #ef4444; }
.request-emails {
    font-size: 0.7rem;
    word-break: break-word;
}
.request-actions button {
    margin-right: 8px;
    margin-top: 4px;
}

/* Demandes de transfert pliable */
.transfer-requests-section {
    margin-top: 12px;
    border-top: 1px solid #e2e8f0;
    padding-top: 8px;
}
.transfer-toggle {
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.transfer-requests-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}
.transfer-request-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 8px;
}
.request-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 4px;
}
.request-status {
    font-weight: 600;
}
.status-pending { color: #f59e0b; }
.status-approved { color: #10b981; }
.status-rejected { color: #ef4444; }
.request-emails {
    font-size: 0.7rem;
    word-break: break-word;
}
.request-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
}
.request-actions .btn-sm {
    background: #f1f5f9;
    border: none;
    border-radius: 0.5rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    cursor: pointer;
}
.request-actions .btn-sm:hover {
    background: #e2e8f0;
}
.btn-resend-event {
    background: #fef9c3;
    color: #854d0e;
    border: none;
    border-radius: 0.5rem;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    margin-left: 0.5rem;
}
.btn-resend-event:hover {
    background: #fde047;
}

/* Ligne des dates avec résumé des stats */
.invite-dates-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.invite-stats-summary {
    font-size: 0.7rem;
    background: #f1f5f9;
    padding: 0.1rem 0.4rem;
    border-radius: 20px;
    color: #475569;
}

/* Demandes de transfert : en-tête distinct */
.request-requester {
    font-weight: 600;
}
.request-date {
    font-size: 0.7rem;
    color: #64748b;
}
.request-actions {
    text-align: right;
}

.invite-dates-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.invite-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Alignement des lignes */
.invite-title-row, .invite-dates-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.action-icons, .status-icons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-icon-action {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.2rem;
    color: #475569;
    transition: color 0.2s;
}
.btn-icon-action:hover {
    color: #3b82f6;
}
.status-icon {
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
}
.transfer-helper-text {
    font-size: 0.7rem;
    font-style: italic;
    color: #64748b;
    margin-bottom: 0.5rem;
    padding: 0.2rem 0;
}

.non-member-email {
    background-color: #fef9c3;
    padding: 0.1rem 0.3rem;
    border-radius: 0.5rem;
    font-style: italic;
    display: inline-block;
    margin: 0 2px;
}

.non-member-badge {
    background-color: #fef9c3;
    color: #854d0e;
    font-size: 0.65rem;
    padding: 0.1rem 0.3rem;
    border-radius: 0.5rem;
    margin-left: 0.4rem;
    white-space: nowrap;
}

/* Bouton Transférer dans la page "Événements reçus" */
.btn-transfer-invitation {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0.25rem 1rem;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.btn-transfer-invitation i {
    font-size: 0.85rem;
}
.btn-transfer-invitation:hover {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(107, 70, 193, 0.3);
}
.btn-transfer-invitation:active {
    transform: translateY(1px);
}

/* Section forfait et offres */
.plan-section {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.current-plan-card {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    border-radius: 1rem;
    padding: 1rem;
    margin: 1rem 0;
}
.plan-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.9rem;
}
.plan-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(255,255,255,0.5);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}
.btn-upgrade {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0.5rem 1.2rem;
    font-weight: 500;
    margin-top: 0.5rem;
    cursor: pointer;
    transition: 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-upgrade:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(59,130,246,0.3);
}
.upgrade-plans-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}
.plan-offer-card {
    background: #f8fafc;
    border-radius: 1rem;
    padding: 1rem;
    width: 280px;
    border: 1px solid #e2e8f0;
    transition: transform 0.1s;
}
.plan-offer-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}
.plan-offer-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}
.plan-price {
    font-weight: 700;
    color: #3b82f6;
}
.plan-offer-desc {
    font-size: 0.85rem;
    color: #475569;
    margin: 0.5rem 0;
}
.plan-features {
    list-style: none;
    padding-left: 0;
    font-size: 0.8rem;
}
.plan-features li {
    margin-bottom: 0.3rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.select-plan-btn {
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0.3rem 1rem;
    width: 100%;
    margin-top: 0.5rem;
    cursor: pointer;
}
.select-plan-btn:hover {
    background: #2563eb;
}

.invite-recurrence {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}
.slider-event-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 0.5rem;
    cursor: pointer;
    transition: transform 0.1s;
}
.slider-event-item:active {
    transform: scale(0.99);
}
.slider-event-time {
    font-size: 0.7rem;
    color: #64748b;
}
.slider-event-title {
    font-weight: 500;
    font-size: 0.85rem;
    border-left: 3px solid;
    padding-left: 0.3rem;
    margin-top: 0.2rem;
}
.slider-event-group {
    font-size: 0.7rem;
    color: #475569;
    margin-top: 0.2rem;
}


/* Description des vues (titre secondaire) */
.view-description {
    font-size: 0.75rem;
    color: #64748b;
    font-style: italic;
    margin-bottom: 1rem;
    padding: 0 0.2rem;
    border-left: 2px solid #e2e8f0;
    padding-left: 0.5rem;
}

/* fin Description des vues (titre secondaire) */

/* ========== POPUP ÉVÉNEMENT MODERNE (DESKTOP) ========== */

.event-popup {
    width: 280px;
    padding: 12px;
    border-radius: 24px;
    background: white;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #eef2f6;
    font-family: 'Inter', system-ui, sans-serif;
}

.event-popup .popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.event-popup .popup-header strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
}
.event-popup .popup-close {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: #94a3b8;
    padding: 2px;
}
.event-popup .popup-time,
.event-popup .popup-group,
.event-popup .popup-recurring,
.event-popup .popup-description {
    font-size: 0.7rem;
    margin: 5px 0;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #475569;
}
.event-popup .popup-cancelled {
    background: #fef2f2;
    color: #b91c1c;
    padding: 4px 8px;
    border-radius: 16px;
    font-size: 0.7rem;
    margin: 6px 0;
}
.popup-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
    border-top: 1px solid #eef2f6;
    padding-top: 10px;
}
.popup-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: 0.1s ease;
    background: #f8fafc;
    color: #334155;
}
.popup-btn i {
    font-size: 0.8rem;
}
.popup-btn:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
}
.popup-btn:active {
    transform: translateY(0);
}
/* Couleurs douces (non flashy) */
.popup-btn.edit {
    background: #eff6ff;
    color: #2563eb;
}
.popup-btn.delete {
    background: #fef2f2;
    color: #dc2626;
}
.popup-btn.cancel {
    background: #fffbeb;
    color: #d97706;
}
.popup-btn.edit-reschedule {
    background: #ecfdf5;
    color: #059669;
}
.popup-btn.notify {
    background: #faf5ff;
    color: #7c3aed;
}
.popup-btn.remove {
    background: #f1f5f9;
    color: #475569;
}
.popup-btn.transfer {
    background: #f0fdf4;
    color: #16a34a;
}

/* ==========FIN  POPUP ÉVÉNEMENT MODERNE (DESKTOP) ========== */