/**
 * Styles pour l'affichage des contacts type cartes de visite
 * Synology CardDAV Contacts Plugin
 */

.scc-contacts-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.scc-contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* Carte de contact - Style carte de visite */
.scc-contact-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #e5e7eb;
    min-height: 0;
    height: auto;
}

.scc-contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

/* Photo de profil */
.scc-card-photo {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.scc-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.scc-photo-placeholder {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.scc-photo-placeholder span {
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Contenu de la carte */
.scc-card-content {
    padding: 24px;
}

.scc-card-name {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 18px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.3;
}

/* Champs d'information */
.scc-card-field {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    font-size: 13px;
    color: #4b5563;
    line-height: 1.5;
}

.scc-card-field:last-child {
    margin-bottom: 0;
}

.scc-field-icon {
    font-size: 16px;
    margin-right: 10px;
    min-width: 20px;
    display: inline-block;
    text-align: center;
}

.scc-card-field a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s ease;
    word-break: break-word;
}

.scc-card-field a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.scc-card-field span:not(.scc-field-icon) {
    flex: 1;
}

/* Message d'erreur */
.scc-error {
    background: #fee2e2;
    color: #991b1b;
    padding: 16px 20px;
    border-radius: 8px;
    border-left: 4px solid #dc2626;
    margin: 20px 0;
    font-size: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .scc-contacts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .scc-contacts-container {
        padding: 15px;
    }

    .scc-card-photo {
        height: 180px;
    }

    .scc-photo-placeholder {
        width: 100px;
        height: 100px;
    }

    .scc-photo-placeholder span {
        font-size: 40px;
    }

    .scc-card-name {
        font-size: 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .scc-contacts-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* Animation de chargement */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scc-contact-card {
    animation: fadeIn 0.5s ease-out;
}

/* Mode compact */
.scc-contacts-grid.scc-compact {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.scc-compact .scc-contact-card {
    min-height: 0;
    height: auto;
}

.scc-compact .scc-card-photo {
    height: 150px;
}

.scc-compact .scc-card-content {
    padding: 15px;
}

.scc-compact .scc-card-name {
    font-size: 18px;
    margin-bottom: 12px;
}

.scc-compact .scc-card-field {
    font-size: 13px;
    margin-bottom: 8px;
}


/* ============================================================
   IMPRESSION — BLOC @media print UNIQUE

   Calcul des hauteurs :
   - Page A4 utile : 297mm - 2×8mm = 281mm
   - Normal  4×4 : (281mm - 4×2mm) ÷ 4 = 68mm par carte
   - Compact 4×5 : (281mm - 5×2mm) ÷ 5 = 54mm par carte

   Photos (doublées par rapport à la version précédente) :
   - Normal  : 40mm  (object-position: center 35% → yeux/nez/bouche)
   - Compact : 30mm  (object-position: center 35%)
   ============================================================ */
@media print {
    @page {
        size: A4 portrait;
        margin: 8mm;
    }

    html {
        -webkit-text-size-adjust: 100%;
    }

    html, body {
        margin: 0 !important;
        padding: 0 !important;
        width: 210mm;
        max-width: 210mm;
        font-size: 10pt;
    }

    .scc-contacts-container {
        display: block !important;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    /* Grille : inline-block, suppression des espaces */
    .scc-contacts-grid {
        display: block !important;
        width: 100% !important;
        font-size: 0 !important;
        line-height: 0 !important;
    }

    /* ── Carte mode NORMAL : 4 lignes × (68+2)mm = 280mm ✓ ── */
    .scc-contact-card {
        display: inline-block !important;
        vertical-align: top !important;
        width: 24% !important;
        margin: 0 0.5% 2mm 0.5% !important;
        font-size: 8pt !important;
        line-height: 1.2 !important;

        height: 70mm !important;
        min-height: 70mm !important;
        max-height: 70mm !important;

        break-inside: avoid !important;
        page-break-inside: avoid !important;
        overflow: hidden !important;

        border: 0.5pt solid #d1d5db !important;
        border-radius: 8px !important;
        padding: 0 !important;
        background: white !important;
        box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.15) !important;
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        box-sizing: border-box !important;
    }

    /* Photo mode normal : 40mm, centrée sur yeux/nez/bouche */
    .scc-card-photo {
        display: block !important;
        width: 100% !important;
        height: 40mm !important;
        min-height: 40mm !important;
        max-height: 40mm !important;
        overflow: hidden !important;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    }

    .scc-card-photo img {
        display: block !important;
        width: 100% !important;
        height: 40mm !important;
        max-height: 40mm !important;
        object-fit: cover !important;
        object-position: center 35% !important; /* yeux/nez/bouche */
    }

    /* Placeholder : annuler le style écran (cercle 120px) */
    .scc-photo-placeholder {
        display: block !important;
        width: 100% !important;
        height: 40mm !important;
        max-height: 40mm !important;
        border-radius: 0 !important;
        border: none !important;
        background: transparent !important;
        line-height: 40mm !important;
        text-align: center !important;
    }

    .scc-photo-placeholder span {
        font-size: 20pt !important;
        color: white !important;
        font-weight: 700 !important;
        line-height: inherit !important;
    }

    /* Contenu */
    .scc-card-content {
        display: block !important;
        padding: 2mm !important;
        line-height: 1.2 !important;
    }

    .scc-card-name {
        font-size: 8pt !important;
        font-weight: 700 !important;
        margin: 0 0 1mm 0 !important;
        line-height: 1.2 !important;
        color: #000 !important;
    }

    .scc-card-field {
        font-size: 7pt !important;
        margin: 0 0 0.8mm 0 !important;
        line-height: 1.2 !important;
        display: flex !important;           /* flex pour aligner icône + texte */
        align-items: flex-start !important;
        color: #000 !important;
    }

    .scc-card-field span:not(.scc-field-icon) {
        flex: 1 !important;                 /* le texte occupe le reste */
    }

    .scc-field-icon {
        font-size: 7pt !important;
        margin-right: 1mm !important;
        flex-shrink: 0 !important;          /* l'icône ne se compresse pas */
    }

    /* Saut de page automatique après 16 cartes (4×4) en mode normal */
    .scc-contacts-grid:not(.scc-compact) .scc-contact-card:nth-child(16n) {
        break-after: page !important;
        page-break-after: always !important;
    }

    .scc-contact-card:last-child {
        break-after: auto !important;
        page-break-after: auto !important;
    }

    /* ── Carte mode COMPACT : 5 lignes × (54+2)mm = 280mm ✓ ── */
    .scc-compact .scc-contact-card {
        height: 54mm !important;
        min-height: 54mm !important;
        max-height: 54mm !important;
    }

    /* Photo compact : 40mm, centrée sur yeux/nez/bouche */
    .scc-compact .scc-card-photo {
        height: 40mm !important;
        min-height: 40mm !important;
        max-height: 40mm !important;
    }

    .scc-compact .scc-card-photo img {
        height: 40mm !important;
        max-height: 40mm !important;
        object-position: center 45% !important; /* yeux/nez/bouche */
    }

    .scc-compact .scc-photo-placeholder {
        height: 40mm !important;
        max-height: 40mm !important;
        line-height: 40mm !important;
    }

    .scc-compact .scc-photo-placeholder span {
        font-size: 16pt !important;
    }

    .scc-compact .scc-card-content {
        padding: 1.5mm 2mm !important;
    }

    .scc-compact .scc-card-name {
        font-size: 7.5pt !important;
        margin: 0 0 0.8mm 0 !important;
    }

    .scc-compact .scc-card-field {
        font-size: 6.5pt !important;
        margin: 0 0 0.5mm 0 !important;
    }

    /* Saut de page après 20 cartes (4×5) en mode compact */
    .scc-contacts-grid.scc-compact .scc-contact-card:nth-child(20n) {
        break-after: page !important;
        page-break-after: always !important;
    }

    /* ── Images circulaires : clip-path fonctionne en impression
       contrairement à border-radius + overflow:hidden sur le conteneur ── */
    .lev-mini-img,
    .lev-single-photo img {
        clip-path: circle(50% at center) !important;
        -webkit-clip-path: circle(50% at center) !important;
    }

    /* ── Card-single en impression ────────────────────────────
       Ajuster les px ci-dessous pour changer la taille de la photo
       Valeur actuelle : 70px (était 200px à l'écran)
       ────────────────────────────────────────────────────────── */
    .lev-single-card {
        width: fit-content !important;
        max-width: 100px !important;  /* largeur max de la carte */
        margin: 0 auto !important;
        padding: 5px 8px !important;  /* padding réduit autour du contenu */
        gap: 4px !important;          /* espace entre photo et texte */
    }
    .lev-single-photo {
        width: 70px !important; /* ← modifier ici pour changer la taille (ex: 60px, 80px, 100px) */
        height: 70px !important; /* ← même valeur que la ligne ci-dessus */
    }
    .lev-single-photo img {
        width: 70px !important;
        height: 70px !important;
        clip-path: circle(50% at center) !important;
        -webkit-clip-path: circle(50% at center) !important;
    }
    .lev-single-name {
        font-size: 7pt !important;
        margin: 2px 0 !important;
    }
    .lev-single-field {
        font-size: 6.5pt !important;
        gap: 3px !important;
    }
    .lev-single-field a {
        word-break: break-all !important; /* coupe l'email long sur plusieurs lignes */
    }

    /* Masquer éléments inutiles */
    .scc-copy-button,
    .scc-contacts-container h1,
    .scc-contacts-container h2 {
        display: none !important;
    }

    /* Tableau en impression */
    .scc-contacts-table {
        font-size: 8pt !important;
        page-break-inside: auto !important;
    }

    .scc-contacts-table thead {
        display: table-header-group !important;
    }

    .scc-contacts-table tr {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }

    .scc-contacts-table th,
    .scc-contacts-table td {
        padding: 2mm 1mm !important;
    }

}   /* ← fin du bloc @media print unique */


/* Liste d'emails */
.scc-email-list-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.scc-email-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.scc-email-list-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 20px;
}

.scc-copy-button {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}

.scc-copy-button:hover {
    background: #764ba2;
}

.scc-email-list {
    background: #f9fafb;
    padding: 15px;
    border-radius: 6px;
    font-family: monospace;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-all;
}

.scc-email-info {
    margin-top: 10px;
    font-size: 13px;
    color: #6b7280;
    font-style: italic;
}

/* Liste d'étiquettes */
.scc-label-list-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.scc-label-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.scc-label-list-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 20px;
}

.scc-label-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.scc-label {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 15px;
    break-inside: avoid;
    page-break-inside: avoid;
}

.scc-label-name {
    font-weight: 600;
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 8px;
}

.scc-label-street,
.scc-label-city {
    font-size: 14px;
    color: #4b5563;
    line-height: 1.5;
}

@media print {
    .scc-label-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Mode enveloppe */
.scc-envelope-list-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.scc-envelope-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.scc-envelope {
    background: #ffffff;
    border: 1px solid #333;
    border-radius: 0;
    padding: 40px 30px;
    break-inside: avoid;
    page-break-inside: avoid;
    min-height: 100px;
    position: relative;
}

.scc-envelope .scc-label-name {
    font-weight: 600;
    font-size: 16px;
    color: #000;
    margin-bottom: 10px;
}

.scc-envelope .scc-label-street,
.scc-envelope .scc-label-city {
    font-size: 15px;
    color: #000;
    line-height: 1.8;
}

/* Impression des enveloppes - Format DL (110x220mm) */
@media print {
    .scc-envelope-list {
        display: block;
    }

    .scc-envelope {
        page-break-after: always;
        width: 220mm;
        height: 110mm;
        padding: 50mm 20mm 20mm 150mm;
        margin: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .scc-envelope::before {
        content: '';
        position: absolute;
        top: 12mm;
        left: 12mm;
        width: 35mm;
        height: 35mm;
        background-image: url('https://www.lutryenvie.ch/wp-content/uploads/2025/12/logo-Lutry-EnVie.png');
        background-size: contain;
        background-repeat: no-repeat;
    }

    .scc-envelope:last-child {
        page-break-after: auto;
    }

    /* @page nommée : n'affecte QUE les éléments avec page: envelope
       et ne perturbe pas les marges des autres pages du site */
    @page envelope {
        size: DL portrait;
        margin: 0;
    }
}

/* Appliquer la page nommée uniquement aux enveloppes */
.scc-envelope {
    page: envelope;
}

/* Liste simple avec dates */
.scc-simple-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}

.scc-simple-list-item {
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #fafafa;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.scc-list-name {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.scc-list-email {
    font-size: 12px;
    color: #666;
}

.scc-list-member-since,
.scc-list-payment {
    font-size: 11px;
    color: #888;
}

.scc-list-payment {
    color: #2563eb;
    font-weight: 500;
}

@media print {
    .scc-simple-list {
        column-count: 4;
        column-gap: 10px;
    }

    .scc-simple-list-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* Ancien style liste (fallback) */
.scc-simple-list-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.scc-simple-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e7eb;
}

.scc-simple-list-header h3 {
    margin: 0;
    color: #1f2937;
    font-size: 20px;
}

.scc-simple-list {
    column-count: 3;
    column-gap: 30px;
}

.scc-simple-list-item {
    font-size: 14px;
    color: #1f2937;
    padding: 6px 0;
    break-inside: avoid;
    page-break-inside: avoid;
}

@media print {
    .scc-simple-list {
        column-count: 4;
    }
}

@media (max-width: 768px) {
    .scc-simple-list {
        column-count: 1;
    }
}

/* Tableau de contacts */
.scc-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
}

.scc-contacts-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: white;
}

.scc-contacts-table thead {
    background: #f8f9fa;
}

.scc-contacts-table th {
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.scc-contacts-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #dee2e6;
}

.scc-contacts-table tbody tr:hover {
    background: #f8f9fa;
}

/* ============================================================
   LEV CONTACTS – Ajouts v1.1
   ============================================================ */

/* ── Couleurs fond initiales selon statut photo ─────────────── */
.lev-ph-refus       { background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%) !important; }
.lev-ph-demandee    { background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%) !important; }
.lev-ph-pas-reponse { background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%) !important; }

/* ── Liens email / téléphone dans le tableau ─────────────────── */
.lev-link { color: #4f46e5; text-decoration: none; }
.lev-link:hover { text-decoration: underline; color: #3730a3; }

/* Colonne téléphone : ne pas couper le numéro */
td:has(> .lev-link[href^="tel"]) { white-space: nowrap; }

/* ── Photo miniature avec hover dans le tableau ──────────────── */
.lev-photo-thumb-wrap {
    position: relative;
    display: inline-block;
}
.lev-photo-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    cursor: pointer;
    transition: transform 0.15s;
}
.lev-photo-thumb:hover { transform: scale(1.1); }

.lev-photo-hover-bubble {
    display: none;
    position: absolute;
    top: 50%;
    left: 40px;
    transform: translateY(-50%);
    z-index: 9000;
    width: 150px;
    height: 150px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.25);
    border: 2px solid #fff;
    background: #f3f4f6;
    pointer-events: none;
}
.lev-photo-hover-bubble img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
}
.lev-photo-thumb-wrap:hover .lev-photo-hover-bubble { display: block; }

/* ── Mode card-mini ──────────────────────────────────────────── */
.lev-mini-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 0;
}
.lev-mini-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100px;
    cursor: default;
}
.lev-mini-photo {
    position: relative;
    width: 100px;
    height: 100px;
}
.lev-mini-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 25%;
    border: 2px solid #e5e7eb;
    display: block;
    transition: border-color .2s;
}
.lev-mini-card:hover .lev-mini-img { border-color: #4f46e5; }

.lev-mini-initiales {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lev-mini-initiales span { font-size: 28px; font-weight: 700; color: #fff; }

/* Hover bulle 400×400 */
.lev-mini-hover {
    display: none;
    position: absolute;
    top: 50%;
    left: 110px;
    transform: translateY(-50%);
    width: 200px;
    height: 200px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0,0,0,.3);
    border: 3px solid #fff;
    background: #f3f4f6;
    z-index: 9000;
    pointer-events: none;
}
.lev-mini-hover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
}
.lev-mini-hover-initiales {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.lev-mini-hover-initiales span { font-size: 64px; font-weight: 700; color: #fff; }
.lev-mini-card:hover .lev-mini-hover { display: block; }

.lev-mini-name {
    font-size: 11px;
    text-align: center;
    color: #374151;
    margin-top: 5px;
    line-height: 1.3;
    word-break: break-word;
    max-width: 100px;
}

/* ── Panneau édition : responsive mobile ─────────────────────── */
#lev-admin-panel {
    display: none;
    position: fixed;
    top: 0; right: 0;
    width: min(440px, 100vw);   /* jamais plus large que l'écran */
    height: 100%;
    height: -webkit-fill-available;
    background: #fff;
    border-left: 2px solid #e5e7eb;
    box-shadow: -8px 0 24px rgba(0,0,0,.12);
    z-index: 9999;
    /* PAS d'overflow ici : c'est lev-panel-inner qui scrolle */
    display: none;
    flex-direction: column;
}
#lev-admin-panel.lev-open {
    display: flex !important;
}

.lev-panel-inner {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
    /* Ajouter un padding-bottom pour que le dernier bouton soit visible */
    padding-bottom: 80px;
}

.lev-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    position: sticky;
    top: -20px;         /* colle au scroll */
    background: #fff;
    z-index: 10;
    padding: 12px 0 8px;
    border-bottom: 1px solid #f3f4f6;
    margin: -20px -20px 14px -20px;
    padding: 12px 20px 8px;
}

.lev-panel-close-btn {
    background: none; border: none;
    font-size: 24px; cursor: pointer;
    color: #9ca3af; padding: 4px 10px;
    line-height: 1;
}
.lev-panel-close-btn:hover { color: #374151; }

.lev-panel-name-badge {
    background: #f3f4f6;
    border-radius: 7px;
    padding: 10px 12px;
    margin-bottom: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
}

/* Boutons d'action : sticky en bas du panneau */
.lev-panel-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding: 12px 0 6px;
    border-top: 1px solid #f3f4f6;
    margin: 16px -20px -80px -20px;
    padding: 12px 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lev-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.lev-btn-save   { background: #059669; color: #fff; }
.lev-btn-save:hover   { background: #047857; }
.lev-btn-delete { background: #ef4444; color: #fff; }
.lev-btn-delete:hover { background: #dc2626; }

#lev-admin-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,.35);
    z-index: 9998;
}

/* Champs formulaire */
.lev-section-title {
    font-size: 11px; font-weight: 700; color: #6b7280;
    text-transform: uppercase; letter-spacing: .05em;
    margin: 14px 0 6px;
    border-bottom: 1px solid #f3f4f6; padding-bottom: 4px;
}
.lev-label { display: block; font-size: 12px; font-weight: 600; color: #4b5563; margin-bottom: 3px; }
.lev-input {
    width: 100%; border: 1px solid #e5e7eb; border-radius: 6px;
    padding: 7px 8px; font-size: 13px; box-sizing: border-box; font-family: inherit;
}
.lev-input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 2px rgba(79,70,229,.15); }
.lev-field { margin-bottom: 8px; }
.lev-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.lev-grid-3 { display: grid; grid-template-columns: 85px 1fr 60px; gap: 8px; margin-bottom: 8px; }
.lev-radio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lev-radio-label {
    display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer;
    padding: 6px 8px; border: 1px solid #e5e7eb; border-radius: 6px;
}
.lev-radio-label:hover { background: #f9fafb; }
.lev-radio-full { grid-column: span 2; }

/* Boutons toolbar */
.lev-btn-tool {
    padding: 6px 12px; color: #fff; border: none;
    border-radius: 6px; font-size: 12px; font-weight: 600;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.lev-btn-tool:hover { opacity: .85; }
.lev-edit-btn {
    background: none; border: none; font-size: 15px;
    cursor: pointer; padding: 2px 5px; color: #6b7280;
}
.lev-edit-btn:hover { color: #4f46e5; }

/* Tableau – colonne téléphone pas de retour à la ligne */
.scc-contacts-table td:nth-child(8) { white-space: nowrap; }

/* Tri */
.scc-contacts-table th.scc-sort-asc  .scc-sort-icon { color: #4f46e5 !important; }
.scc-contacts-table th.scc-sort-desc .scc-sort-icon { color: #4f46e5 !important; }
.scc-row-demission td { opacity: .75; }
.scc-row-decede    td { opacity: .5; }

/* Responsive mobile : panneau plein écran */
@media (max-width: 480px) {
    #lev-admin-panel {
        width: 100vw !important;
        border-left: none;
    }
    .lev-grid-3 {
        grid-template-columns: 75px 1fr 55px;
    }
}

/* ============================================================
   LEV CONTACTS – Corrections v1.2
   ============================================================ */

/* ── Panneau édition : espace suffisant avant les boutons fixes ─ */
/* Le padding-bottom doit être assez grand pour que le contenu
   ne soit pas masqué par la barre sticky des boutons (~100px)    */
.lev-panel-inner {
    padding-bottom: 120px !important;
}

/* Boutons d'action : vraiment sticky en bas du PANNEAU,
   pas de la page. On utilise position sticky dans le flux.       */
.lev-panel-actions {
    position: sticky !important;
    bottom: 0 !important;
    background: #fff !important;
    border-top: 2px solid #e5e7eb !important;
    padding: 14px 20px 20px !important;
    margin: 0 -20px -120px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    z-index: 10 !important;
}

/* ── Card-mini : vignettes discrètes, initiales petites ───────── */

/* Grille plus dense */
.lev-mini-grid {
    gap: 8px !important;
}

/* Vignette exactement 100×100 */
.lev-mini-card {
    width: 100px !important;
}
.lev-mini-photo {
    width: 100px !important;
    height: 100px !important;
}
.lev-mini-img {
    width: 100px !important;
    height: 100px !important;
    border: 1.5px solid #e5e7eb !important;
}

/* Initiales dans le cercle : même taille que la vignette,
   texte discret (pas énorme)                                     */
.lev-mini-initiales {
    width: 100px !important;
    height: 100px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1.5px solid rgba(0,0,0,.08) !important;
}
.lev-mini-initiales span {
    font-size: 22px !important;   /* discret, comme du texte */
    font-weight: 600 !important;
    color: rgba(255,255,255,.85) !important;
    letter-spacing: .02em !important;
}

/* Nom sous la vignette : léger */
.lev-mini-name {
    font-size: 10px !important;
    color: #6b7280 !important;
    margin-top: 4px !important;
    font-weight: 400 !important;
}

/* Hover bulle agrandie : positionnée intelligemment */
.lev-mini-hover {
    width: 180px !important;
    height: 180px !important;
    left: 108px !important;
    border-radius: 8px !important;
}

/* Sur petits écrans : bulle vers le bas pour éviter le débordement */
@media (max-width: 600px) {
    .lev-mini-hover {
        top: 108px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }
}

/* ============================================================
   LEV CONTACTS – Corrections v1.3
   ============================================================ */

/* ── Panneau : boutons APRÈS le contenu, pas par-dessus ──────── */
/* Approche alternative : plus de sticky, les boutons sont
   simplement en bas du formulaire, dans le flux normal.
   Le padding-bottom laisse de l'espace pour scroller jusqu'à eux. */
.lev-panel-actions {
    position: static !important;
    margin: 20px 0 0 0 !important;
    padding: 14px 0 6px !important;
    border-top: 2px solid #e5e7eb !important;
}

/* Plus de padding-bottom excessif maintenant que les boutons
   ne sont plus en sticky                                         */
.lev-panel-inner {
    padding-bottom: 30px !important;
}

/* ── Card-mini : couleur "aucun" (pas de statut photo) ───────── */
/* Fond gris très clair + texte gris foncé lisible               */
.lev-mini-initiales.scc-photo-placeholder:not(.lev-ph-refus):not(.lev-ph-demandee):not(.lev-ph-pas-reponse) {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%) !important;
    border: 1.5px solid #c4c9d0 !important;
}
.lev-mini-initiales.scc-photo-placeholder:not(.lev-ph-refus):not(.lev-ph-demandee):not(.lev-ph-pas-reponse) span {
    color: #4b5563 !important;
}

/* Texte des initiales lisible pour toutes les catégories        */
.lev-mini-initiales.lev-ph-refus span       { color: #7f1d1d !important; }
.lev-mini-initiales.lev-ph-demandee span    { color: #78350f !important; }
.lev-mini-initiales.lev-ph-pas-reponse span { color: #374151 !important; }

/* Idem pour card / card-small */
.scc-photo-placeholder:not(.lev-ph-refus):not(.lev-ph-demandee):not(.lev-ph-pas-reponse) {
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%) !important;
}
.scc-photo-placeholder:not(.lev-ph-refus):not(.lev-ph-demandee):not(.lev-ph-pas-reponse) span {
    color: #4b5563 !important;
}
.scc-photo-placeholder.lev-ph-refus span       { color: #7f1d1d !important; }
.scc-photo-placeholder.lev-ph-demandee span    { color: #78350f !important; }
.scc-photo-placeholder.lev-ph-pas-reponse span { color: #374151 !important; }


/* Légende */
.scc-legend {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.scc-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.scc-legend-box {
    display: inline-block;
    width: 30px;
    height: 15px;
    border-radius: 3px;
}
.scc-legend-box.scc-photo-refusee {
    background-color: #ef4444;
}

.scc-legend-box.scc-photo-demandee {
    background-color: #f59e0b;
}

.scc-legend-box.scc-photo-pas-reponse {
    background-color: #9ca3af;
}

.scc-legend-box.scc-photo-nouveau {
    background-color: #e5e7eb;
}


/* ============================================================
   LEV CONTACTS – card-single
   CSS indépendant de card-small – personnalisable librement
   ============================================================ */

.lev-single-card {
    display: flex;
    flex-direction: column;    /* photo AU-DESSUS, texte EN-DESSOUS */
    align-items: center;       /* centré horizontalement */
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    width: fit-content;
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(0,0,0,.07);
    margin: 0 auto;
}

/* Photo ronde */
.lev-single-photo {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
}
.lev-single-photo img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 20%;
    border: 2px solid #e5e7eb;
    display: block;
}

/* Placeholder initiales (copie de card-small) */
.lev-single-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e5e7eb 0%, #d1d5db 100%);
    border: 1.5px solid rgba(0,0,0,.08);
}
.lev-single-placeholder span {
    font-size: 22px;
    font-weight: 700;
    color: #4b5563;
    letter-spacing: .02em;
}
/* Couleurs statut photo */
.lev-single-placeholder.lev-ph-refus {
    background: linear-gradient(135deg, #fca5a5 0%, #ef4444 100%);
}
.lev-single-placeholder.lev-ph-refus span { color: #7f1d1d; }

.lev-single-placeholder.lev-ph-demandee {
    background: linear-gradient(135deg, #fde68a 0%, #f59e0b 100%);
}
.lev-single-placeholder.lev-ph-demandee span { color: #78350f; }

.lev-single-placeholder.lev-ph-pas-reponse {
    background: linear-gradient(135deg, #d1d5db 0%, #9ca3af 100%);
}
.lev-single-placeholder.lev-ph-pas-reponse span { color: #374151; }

/* Contenu texte */
.lev-single-content {
    display: flex;
    flex-direction: column;
    align-items: center;       /* centré sous la photo */
    gap: 5px;
    text-align: center;
}
.lev-single-name {
    font-size: 15px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 2px 0;
    white-space: normal;
}
.lev-single-field {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #4b5563;
}
.lev-single-field a {
    color: #4f46e5;
    text-decoration: none;
    word-break: break-all;
}
.lev-single-field a:hover { text-decoration: underline; }
.lev-single-icon {
    font-size: 14px;
    flex-shrink: 0;
}

/* Statut partenaire - texte bleu discret */
.scc-row-partenaire td { color: #1d4ed8; }

/* =================================================================
   COULEUR DE LIGNE non-paiement dans lev-contacts
   ================================================================= */
.scc-row-non-paiement {
    background-color: #fef2f2 !important;
    color: #991b1b;
}