/* ========================================
   FEEDBACK / DISCUSSION COMPONENT
   Interface de messagerie moderne
   ======================================== */

/* ========================================
   CONTENEUR PRINCIPAL
   ======================================== */

.feedback-discussion {
    max-width: 900px;
    margin: 0 auto;
    background-color: var(--surface, #ffffff);
    border-radius: var(--radius-lg, 12px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* ========================================
   EN-TÊTE DU FEEDBACK
   ======================================== */

.feedback-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--line, #e5e7eb);
    background: linear-gradient(135deg, var(--surface) 0%, rgba(59, 130, 246, 0.02) 100%);
}

.feedback-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.feedback-header__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-header__title .material-symbols-outlined {
    font-size: 1.5rem;
    color: var(--primary, #3b82f6);
}

.feedback-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md, 8px);
    font-size: 0.875rem;
    font-weight: 500;
}

.feedback-status--en-attente {
    background-color: #fef3c7;
    color: #92400e;
}

.feedback-status--en-cours {
    background-color: #dbeafe;
    color: #1e40af;
}

.feedback-status--termine {
    background-color: #d1fae5;
    color: #065f46;
}



/* ========================================
   ZONE DE MESSAGES
   ======================================== */

.feedback-messages {
    padding: 1.5rem;
    max-height: 600px;
    overflow-y: auto;
    background-color: #f9fafb;
}

/* Scrollbar personnalisée */
.feedback-messages::-webkit-scrollbar {
    width: 8px;
}

.feedback-messages::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.feedback-messages::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.feedback-messages::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========================================
   SÉPARATEUR DE DATE
   ======================================== */

.message-date-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.message-date-divider::before,
.message-date-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}

.message-date-divider__text {
    padding: 0.25rem 1rem;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

/* ========================================
   BULLES DE MESSAGE
   ======================================== */

.message-bubble {
    display: flex;
    margin-bottom: 0.75rem;
    animation: messageSlideIn 0.2s ease-out;
}

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

/* Message utilisateur (droite) */
.message-bubble--user {
    justify-content: flex-end;
}

.message-bubble--user .message-bubble__content {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border-radius: 12px 12px 4px 12px;
}

/* Message admin (gauche) */
.message-bubble--admin {
    justify-content: flex-start;
}

.message-bubble--admin .message-bubble__content {
    background-color: #ffffff;
    color: var(--text-primary, #111827);
    border: 1px solid #e5e7eb;
    border-radius: 12px 12px 12px 4px;
}

/* Contenu de la bulle */
.message-bubble__content {
    max-width: 70%;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-bubble__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-bubble__time {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

.message-bubble--user .message-bubble__time {
    text-align: right;
}

.message-bubble--admin .message-bubble__time {
    text-align: left;
    color: var(--text-secondary, #6b7280);
}

/* ========================================
   MESSAGE INITIAL (Premier message)
   ======================================== */

.message-initial {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.message-initial__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: #92400e;
}

.message-initial__header .material-symbols-outlined {
    font-size: 1.25rem;
}

.message-initial__text {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #78350f;
}

.message-initial__time {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: #92400e;
    font-weight: 500;
}

/* ========================================
   FICHIER JOINT
   ======================================== */

.message-attachment {
    display: flex;
    margin-bottom: 0.75rem;
}

.message-attachment--user {
    justify-content: flex-end;
}

.message-attachment__content {
    max-width: 70%;
    background-color: #ffffff;
    border: 2px dashed #3b82f6;
    border-radius: 12px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.message-attachment__content:hover {
    border-color: #2563eb;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.1);
    transform: translateY(-1px);
}

.message-attachment__icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 1.5rem;
}

.message-attachment__info {
    flex: 1;
    min-width: 0;
}

.message-attachment__name {
    font-weight: 500;
    color: var(--text-primary, #111827);
    margin: 0 0 0.25rem 0;
    font-size: 0.9375rem;
}

.message-attachment__link {
    color: var(--primary, #3b82f6);
    text-decoration: none;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.message-attachment__link:hover {
    text-decoration: underline;
}

.message-attachment__link .material-symbols-outlined {
    font-size: 1rem;
}

/* ========================================
   ÉTAT VIDE
   ======================================== */

.feedback-empty {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary, #6b7280);
}

.feedback-empty .material-symbols-outlined {
    font-size: 4rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.feedback-empty__text {
    font-size: 1rem;
    margin: 0;
}

/* ========================================
   FORMULAIRE DE RÉPONSE
   ======================================== */

.feedback-reply-form {
    padding: 1.5rem;
    border-top: 1px solid var(--line, #e5e7eb);
    background-color: var(--surface, #ffffff);
    border-radius: 0 0 12px 12px;
}

.feedback-reply-form form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.feedback-reply-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.9375rem;
    resize: vertical;
    transition: all 0.2s ease;
}

.feedback-reply-form textarea:focus {
    outline: none;
    border-color: var(--primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.feedback-reply-form__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ========================================
   BOUTON D'ACTION (Répondre)
   ======================================== */

.feedback-action {
    padding: 1.5rem;
    border-top: 1px solid var(--line, #e5e7eb);
    background-color: var(--surface, #ffffff);
    display: flex;
    justify-content: center;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .feedback-discussion {
        border-radius: 0;
    }

    .feedback-header__top {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .feedback-header__meta {
        gap: 1rem;
        font-size: 0.8125rem;
    }

    .feedback-messages {
        max-height: 500px;
    }

    .message-bubble__content,
    .message-attachment__content {
        max-width: 85%;
    }

    .feedback-reply-form {
        padding: 1rem;
    }
}

/* ========================================
   WIDGET FLOTTANT (fb-widget)
   ======================================== */

/* ── Widget container ─────────────────────────────────────────── */
.fb-widget          { position: fixed; bottom: 28px; right: 28px; z-index: 9000; font-family: inherit; }

/* ── Toggle button ───────────────────────────────────────────── */
.fb-widget__btn {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--bouton-primaire);
    color: #fff;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 16px rgba(0,0,0,.22);
    transition: transform .18s, box-shadow .18s;
    position: relative;
}
.fb-widget__btn:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,.28); }
.fb-widget__btn .material-symbols-outlined { font-size: 26px; }
.fb-widget__badge {
    position: absolute; top: -4px; right: -4px;
    background: #ef4444; color: #fff;
    font-size: 11px; font-weight: 700;
    min-width: 18px; height: 18px;
    border-radius: 9px; padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
}

/* ── Panel ───────────────────────────────────────────────────── */
.fb-widget__panel {
    position: absolute; bottom: 68px; right: 0;
    width: 380px;
    max-height: min(500px, calc(100svh - 90px));
    background: var(--surface-color, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,.18);
    overflow: hidden;
    display: flex; flex-direction: column;
    transform-origin: bottom right;
    transform: scale(.92) translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: transform .22s cubic-bezier(.34,1.56,.64,1), opacity .18s;
}
.fb-widget__panel.fb-open {
    transform: scale(1) translateY(0);
    opacity: 1;
    pointer-events: all;
}
@media (max-width: 440px) {
    .fb-widget__panel { width: calc(100vw - 32px); right: 0; }
}

/* ── Panel header ─────────────────────────────────────────────── */
.fb-widget__header {
    background: var(--bouton-primaire);
    color: #fff;
    padding: 14px 18px;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.fb-widget__header h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.fb-widget__header h3 .material-symbols-outlined { font-size: 20px; }
.fb-widget__close-btn {
    background: none; border: none; cursor: pointer;
    color: rgba(255,255,255,.8); padding: 4px;
    border-radius: 4px; display: flex; align-items: center;
    transition: color .15s;
}
.fb-widget__close-btn:hover { color: #fff; }

/* ── Panel body ───────────────────────────────────────────────── */
.fb-widget__body { padding: 16px 18px; flex: 1 1 auto; overflow-y: auto; min-height: 0; }

.fb-widget__field { margin-bottom: 12px; }
.fb-widget__field label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--text-muted, #6b7280); margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: .04em;
}
.fb-widget__field input,
.fb-widget__field select,
.fb-widget__field textarea {
    width: 100%; box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid var(--border-color, #d1d5db);
    border-radius: 8px;
    font-size: 14px;
    background: var(--input-bg, #f9fafb);
    color: var(--text-color, #111827);
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}
.fb-widget__field input:focus,
.fb-widget__field select:focus,
.fb-widget__field textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
    background: var(--surface-color, #fff);
}
.fb-widget__field textarea { resize: vertical; min-height: 80px; }
.fb-widget__field .fb-hint {
    font-size: 11px; color: var(--text-muted, #9ca3af); margin-top: 3px;
}
.fb-widget__field input[type="file"] { padding: 5px; background: var(--surface-color, #fff); }

/* Context group */
.fb-widget__context-toggle {
    width: 100%; background: none; border: 1px dashed var(--border-color, #d1d5db);
    border-radius: 8px; padding: 8px 12px; cursor: pointer;
    font-size: 13px; color: var(--text-muted, #6b7280);
    display: flex; align-items: center; gap: 6px;
    margin-bottom: 12px; transition: border-color .15s, color .15s;
    font-family: inherit;
}
.fb-widget__context-toggle:hover { border-color: var(--primary); color: var(--pastille-principale-texte); }
.fb-widget__context-toggle .material-symbols-outlined { font-size: 18px; }
.fb-widget__context { display: none; }
.fb-widget__context.fb-visible { display: block; }

/* Screenshot preview */
.fb-preview {
    margin-top: 6px; border-radius: 8px; overflow: hidden;
    border: 1px solid var(--border-color, #e5e7eb); display: none;
}
.fb-preview img { width: 100%; display: block; max-height: 160px; object-fit: contain; background: #f3f4f6; }

/* ── Actions ─────────────────────────────────────────────────── */
.fb-widget__actions {
    padding: 12px 18px;
    border-top: 1px solid var(--border-color, #e5e7eb);
    display: flex; gap: 10px; justify-content: flex-end;
    flex-shrink: 0;
}
.fb-widget__submit {
    padding: 9px 20px; border-radius: 8px;
    background: var(--bouton-primaire); color: var(--encre-sur-primaire);
    border: none; cursor: pointer; font-size: 14px; font-weight: 600;
    display: flex; align-items: center; gap: 6px;
    transition: background .15s, opacity .15s;
    font-family: inherit;
}
.fb-widget__submit:hover  { background: var(--primary-dark); }
.fb-widget__submit:disabled { opacity: .6; cursor: not-allowed; }
.fb-widget__cancel {
    padding: 9px 14px; border-radius: 8px;
    background: none; border: 1px solid var(--border-color, #d1d5db);
    color: var(--text-muted, #6b7280); cursor: pointer; font-size: 14px;
    transition: border-color .15s, color .15s; font-family: inherit;
}
.fb-widget__cancel:hover { border-color: var(--primary); color: var(--pastille-principale-texte); }

/* ── Navigation bar ──────────────────────────────────────────── */
.fb-widget__nav {
    display: flex; border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--surface-color, #fff);
    flex-shrink: 0;
}
.fb-widget__nav button {
    flex: 1; padding: 9px 6px; background: none; border: none; cursor: pointer;
    font-size: 12px; font-weight: 600; color: var(--text-muted, #6b7280);
    display: flex; align-items: center; justify-content: center; gap: 5px;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
    transition: color .15s, border-color .15s; font-family: inherit;
}
.fb-widget__nav button .material-symbols-outlined { font-size: 16px; }
.fb-widget__nav button:hover { color: var(--pastille-principale-texte); }
.fb-widget__nav button.fb-nav-active { color: var(--pastille-principale-texte); border-bottom-color: var(--primary); }
.fb-nav-badge {
    background: #ef4444; color: #fff; font-size: 10px; font-weight: 700;
    min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
}

/* ── Conversations list ────────────────────────────────────────── */
.fb-view-convs, .fb-view-detail { display: none; }
.fb-view-convs.fb-view-active { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.fb-view-detail.fb-view-active { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
#fb-form-wrapper { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.fb-convs-empty { padding: 24px 18px; text-align: center; color: var(--text-muted, #9ca3af); font-size: 14px; }
.fb-convs-empty .material-symbols-outlined { font-size: 36px; display: block; margin: 0 auto 8px; opacity: .5; }
.fb-convs-list { list-style: none; margin: 0; padding: 0; }
.fb-conv-item {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 18px; border-bottom: 1px solid var(--border-color, #f3f4f6);
    cursor: pointer; transition: background .12s;
    background: none; border-top: none; border-left: none; border-right: none;
    width: 100%; text-align: left; font-family: inherit;
}
.fb-conv-item:hover { background: var(--hover-bg, #f9fafb); }
.fb-conv-item__icon { flex-shrink: 0; width: 32px; height: 32px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 10%, transparent); display: flex; align-items: center; justify-content: center; }
.fb-conv-item__icon .material-symbols-outlined { font-size: 18px; color: var(--pastille-principale-texte); }
.fb-conv-item__body { flex: 1; min-width: 0; }
.fb-conv-item__sujet { font-size: 13px; font-weight: 600; color: var(--text-color, #111827); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-conv-item__meta { font-size: 11px; color: var(--text-muted, #6b7280); margin-top: 2px; }
.fb-conv-item__arrow { font-size: 18px; color: var(--text-muted, #9ca3af); flex-shrink: 0; }

/* ── Conversation detail / chat ──────────────────────────────── */
.fb-detail-header {
    padding: 10px 18px 10px 10px; display: flex; align-items: center; gap: 8px;
    border-bottom: 1px solid var(--border-color, #e5e7eb); min-height: 44px; flex-shrink: 0;
}
.fb-detail-back {
    background: none; border: none; cursor: pointer; padding: 4px; border-radius: 6px;
    color: var(--text-muted, #6b7280); display: flex; align-items: center;
    transition: color .12s, background .12s; flex-shrink: 0;
}
.fb-detail-back:hover { color: var(--pastille-principale-texte); background: color-mix(in srgb, var(--primary) 7%, transparent); }
.fb-detail-back .material-symbols-outlined { font-size: 20px; }
.fb-detail-title { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-chat { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; max-height: 55vh; }
.fb-bubble-row { display: flex; gap: 8px; }
.fb-bubble-row--user { justify-content: flex-end; }
.fb-bubble-row--admin { justify-content: flex-start; }
.fb-bubble {
    max-width: 80%; padding: 9px 13px; border-radius: 14px;
    font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
}
.fb-bubble--user { background: var(--bouton-primaire); color: var(--encre-sur-primaire); border-bottom-right-radius: 4px; }
.fb-bubble--admin { background: var(--input-bg, #f3f4f6); color: var(--text-color, #111827); border-bottom-left-radius: 4px; }
.fb-bubble__time { font-size: 10px; opacity: .6; margin-top: 3px; }
.fb-bubble-row--user .fb-bubble__time { text-align: right; }
.fb-chat-loading, .fb-chat-clos {
    text-align: center; padding: 10px 16px; font-size: 12px; color: var(--text-muted, #9ca3af);
    border-top: 1px solid var(--border-color, #e5e7eb); flex-shrink: 0;
}
.fb-chat-clos { background: var(--input-bg, #f9fafb); }

/* ── Mode selector ────────────────────────────────────────────── */
.fb-mode-selector { display: flex; gap: 10px; margin-bottom: 16px; }
.fb-mode-card {
    flex: 1; padding: 12px 8px;
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 12px; background: none; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    font-family: inherit; transition: border-color .15s, background .15s, color .15s;
    color: var(--text-muted, #6b7280);
}
.fb-mode-card .material-symbols-outlined { font-size: 26px; }
.fb-mode-card .fb-mode-label { font-size: 12px; font-weight: 700; }
.fb-mode-card .fb-mode-desc { font-size: 10px; opacity: .75; text-align: center; line-height: 1.3; }
.fb-mode-card:hover { border-color: var(--primary); color: var(--pastille-principale-texte); }
.fb-mode-card.fb-mode-active.fb-mode-problem { border-color: #f97316; background: rgba(249,115,22,.07); color: #f97316; }
.fb-mode-card.fb-mode-active.fb-mode-question { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 7%, transparent); color: var(--pastille-principale-texte); }
.fb-mode-probleme-only { transition: opacity .15s; }
.fb-mode-probleme-only.fb-mode-hidden { display: none !important; }

/* ── Success / Error states ───────────────────────────────────── */
.fb-widget__success {
    padding: 28px 18px; text-align: center; display: none;
}
.fb-widget__success .material-symbols-outlined { font-size: 48px; color: #22c55e; }
.fb-widget__success h4 { margin: 10px 0 4px; font-size: 16px; }
.fb-widget__success p { font-size: 14px; color: var(--text-muted, #6b7280); margin: 0; }
.fb-widget__error {
    margin: 0 18px 12px;
    padding: 10px 12px; border-radius: 8px;
    background: #fef2f2; border: 1px solid #fca5a5;
    color: #b91c1c; font-size: 13px; display: none;
}

/* ── Spinner animation : @keyframes fb-spin vit dans components/_utilities.css, chargée sur toutes les pages (la fiche
   d'un bâtiment s'en sert sans cette feuille : bouton « Envoi… » des notices, templates/batiment/voir.html.twig). ── */

/* ========================================
   ADMIN – PAGE AFFICHER
   (afficher.html.twig)
   ======================================== */

.feedback-context {
    border-left: 4px solid var(--primary);
}
.feedback-context__body {
    padding: 14px 18px;
}
.feedback-context__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.feedback-context__title .material-symbols-outlined { font-size: 18px; }
.feedback-context__dl {
    display: grid;
    gap: 8px;
    margin: 0;
}
.feedback-context__row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 8px;
    align-items: start;
}
.feedback-context__row--center { align-items: center; }
.feedback-context__dt {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    display: flex;
    align-items: center;
    gap: 5px;
}
.feedback-context__dt .material-symbols-outlined { font-size: 16px; }
.feedback-context__dd {
    margin: 0;
    font-size: 13px;
    word-break: break-all;
}
.feedback-context__dd--normal { word-break: normal; }
.feedback-context__link {
    color: var(--pastille-principale-texte);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}
.feedback-context__link .material-symbols-outlined { font-size: 13px; }

/* Carte expéditeur + contexte, côte à côte quand il y a du contexte */
.fb-top {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}
.fb-top--2cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 900px) {
    .fb-top--2cols { grid-template-columns: 1fr; }
}

.fb-sender {
    padding: 14px 18px;
    border-left: 4px solid var(--accent, #10c2a6);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.fb-sender__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: .04em;
}
.fb-sender__title .material-symbols-outlined { font-size: 18px; }
.fb-sender__head {
    display: flex;
    align-items: center;
    gap: 12px;
}
.fb-sender__avatar {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary, #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: .02em;
}
.fb-sender__avatar--guest {
    background: var(--line, #e6ebf3);
    color: var(--muted, #5b6b80);
}
.fb-sender__identity { min-width: 0; }
.fb-sender__name {
    font-weight: 700;
    font-size: 16px;
}
.fb-sender__name a { color: inherit; text-decoration: none; }
.fb-sender__name a:hover { color: var(--primary, #2563eb); }
.fb-sender__email {
    font-size: 13px;
    color: var(--primary, #2563eb);
    text-decoration: none;
    word-break: break-all;
}
.fb-sender__metier {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}
.fb-sender__metier .material-symbols-outlined { font-size: 15px; }
.fb-sender__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.fb-sender__stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
}
.fb-sender__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 6px;
    border-radius: var(--br, 8px);
    background: var(--bg-secondary, #f3f4f6);
    text-align: center;
}
.fb-sender__stat-value {
    font-weight: 700;
    font-size: 18px;
    line-height: 1.2;
}
.fb-sender__stat-label {
    font-size: 12px;
    color: var(--text-muted, #6b7280);
}
.fb-sender__dates {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 24px;
    margin: 0;
    font-size: 13px;
}
.fb-sender__dates dt {
    font-weight: 600;
    color: var(--text-muted, #6b7280);
}
.fb-sender__dates dd { margin: 0; }
.fb-sender__notes {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-radius: var(--br, 8px);
    background: var(--warning-bg-color, #fff3cd);
    color: var(--warning-color, #856404);
    font-size: 13px;
    line-height: 1.45;
}
.fb-sender__notes .material-symbols-outlined { font-size: 16px; }
.fb-sender__cta { align-self: flex-start; }

/* ========================================
   ADMIN – PAGE RÉPONDRE
   (repondre.html.twig)
   ======================================== */

.chat-messages__count {
    font-size: 13px;
    color: var(--text-muted, #6b7280);
}
.chat-messages {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 60vh;
    overflow-y: auto;
}
.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}
.chat-msg--user { align-self: flex-start; }
.chat-msg--admin { align-self: flex-end; }
.chat-msg__bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}
.chat-msg--user .chat-msg__bubble {
    background: var(--bg-secondary, #f3f4f6);
    color: var(--text-color, #111827);
    border-bottom-left-radius: 4px;
}
.chat-msg--admin .chat-msg__bubble {
    background: var(--bouton-primaire);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.chat-msg__meta {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    margin-top: 4px;
    padding: 0 4px;
}
.chat-msg--admin .chat-msg__meta { text-align: right; }
.chat-date-sep {
    text-align: center;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    position: relative;
    margin: 6px 0;
}
.chat-date-sep::before, .chat-date-sep::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border-color, #e5e7eb);
}
.chat-date-sep::before { left: 0; }
.chat-date-sep::after { right: 0; }

/* ========================================
   ADMIN – PARTIAL CHAT (_feedback.html.twig)
   ======================================== */

.adm-chat { display: flex; flex-direction: column; gap: 10px; padding: 4px 0; }
.adm-chat-msg { display: flex; flex-direction: column; max-width: 78%; }
.adm-chat-msg--user  { align-self: flex-start; }
.adm-chat-msg--admin { align-self: flex-end; }
.adm-chat-msg__bubble { padding: 10px 14px; border-radius: 14px; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.adm-chat-msg--user  .adm-chat-msg__bubble { background: var(--bg-secondary, #f3f4f6); color: var(--text-color, #111827); border-bottom-left-radius: 4px; }
.adm-chat-msg--admin .adm-chat-msg__bubble { background: var(--bouton-primaire); color: var(--encre-sur-primaire); border-bottom-right-radius: 4px; }
.adm-chat-msg__meta { font-size: 11px; color: var(--text-muted, #9ca3af); margin-top: 4px; padding: 0 4px; display: flex; align-items: center; gap: 3px; }
.adm-chat-msg--admin .adm-chat-msg__meta { justify-content: flex-end; }
.adm-chat-date { text-align: center; font-size: 11px; color: var(--text-muted, #9ca3af); position: relative; margin: 6px 0; }
.adm-chat-date::before, .adm-chat-date::after { content: ''; position: absolute; top: 50%; width: 38%; height: 1px; background: var(--border-color, #e5e7eb); }
.adm-chat-date::before { left: 0; }
.adm-chat-date::after  { right: 0; }
.adm-chat-empty { text-align: center; padding: 20px; color: var(--text-muted, #9ca3af); font-size: 13px; }
.adm-chat-empty .material-symbols-outlined { font-size: 28px; display: block; margin-bottom: 4px; opacity: .4; }

/* Chat: file attachment link */
.adm-chat-file-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--pastille-principale-texte);
    font-size: 13px;
    text-decoration: none;
}
.adm-chat-file-link .material-symbols-outlined { font-size: 18px; }
.adm-chat-file-link .adm-chat-file-link__open { font-size: 14px; }

/* Chat: compact bubble (image/attachment) */
.chat-msg__bubble--compact,
.adm-chat-msg__bubble--compact { padding: 6px; }

/* Chat: screenshot images */
.chat-screenshot-img {
    max-width: 100%;
    max-height: 180px;
    border-radius: 8px;
    display: block;
}
.adm-chat-screenshot-img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    display: block;
}

/* Chat: icon sizes in meta */
.chat-msg__meta .material-symbols-outlined { font-size: 12px; vertical-align: middle; }
.adm-chat-msg__meta .material-symbols-outlined { font-size: 12px; }

/* ========================================
   ADMIN – INDEX MESSAGERIE
   (index.html.twig)
   ======================================== */

/* Compteur sur les boutons-onglets de filtre */
.feedback-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3em;
    padding: 0 0.35em;
    height: 1.3em;
    border-radius: 999px;
    font-size: 0.75em;
    font-weight: 600;
    background: rgba(255,255,255,0.25);
    margin-left: 0.35em;
    line-height: 1;
}
.feedback-tab-count--alert {
    background: #dc2626;
    color: #fff;
}

/* Champ de recherche pleine largeur dans le filtre */
.feedback-search-field {
    flex: 1;
    margin-bottom: 0;
}

/* Position relative for the colored left border rows */
.feedback-list .info-row { position: relative; }

/* Action buttons group in each row */
.feedback-list .info-row__action {
    display: flex;
    gap: 6px;
    align-items: center;
}
.feedback-list .info-row__action .material-symbols-outlined { font-size: 15px; }

/* Unread indicator dot */
.feedback-unread-dot {
    color: #ef4444;
    margin-right: 4px;
}

/* Type pill badge (bug/question) */
.feedback-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}
.feedback-type-badge .material-symbols-outlined { font-size: 13px; }
/* Les deux types, en couleurs nommées (lot « composants », 24/10/2026 ; auparavant en ligne dans les gabarits, et
   le bleu #2563eb tombait à 2,7:1 sur le fond sombre) : texte à 4,5:1 au moins dans les deux thèmes. */
.feedback-type-badge--question { background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--pastille-principale-texte); }
.feedback-type-badge--probleme { background: color-mix(in srgb, var(--teinte-orange-vif) 10%, transparent); color: var(--etat-manque); }
