/* =============================================
   MILO'LOC — Chat Widget
   Chargé uniquement quand chat_actif = 1
   ============================================= */

/* === Variables === */
.chat-widget {
    --chat-accent: var(--accent, #E07260);
    --chat-accent-hover: var(--accent-hover, #CC614F);
    --chat-bg: var(--bg-card, #FFFFFF);
    --chat-bg-subtle: var(--bg-subtle, #F3F1EE);
    --chat-text: var(--text, #2B2D42);
    --chat-text-secondary: var(--text-secondary, #6B7280);
    --chat-text-muted: var(--text-muted, #9CA3AF);
    --chat-text-on-color: var(--text-on-color, #FFFFFF);
    --chat-border: var(--border, #E8E6E1);
    --chat-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    --chat-radius: 16px;
    --chat-radius-sm: 8px;
    --chat-bubble-size: 56px;
    --chat-panel-width: 380px;
    --chat-panel-height: 500px;
    --chat-z: 9999;
    --chat-font: var(--font-body, 'Plus Jakarta Sans', system-ui, sans-serif);
}

/* === Widget conteneur === */
.chat-widget {
    position: fixed;
    z-index: var(--chat-z);
    font-family: var(--chat-font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--chat-text);
}

.chat-widget--bottom-right {
    bottom: 20px;
    right: 20px;
}

.chat-widget--bottom-left {
    bottom: 20px;
    left: 20px;
}

/* === Bouton bulle flottante === */
.chat-bubble {
    width: var(--chat-bubble-size);
    height: var(--chat-bubble-size);
    border-radius: 50%;
    background: var(--chat-accent);
    color: var(--chat-text-on-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.chat-bubble:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.chat-bubble:focus-visible {
    outline: 3px solid var(--chat-accent);
    outline-offset: 3px;
}

.chat-bubble-icon {
    color: var(--chat-text-on-color);
}

/* Badge compteur */
.chat-bubble-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--danger, #D97B7B);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border: 2px solid var(--chat-bg);
}

/* Pulse animation */
.chat-bubble--pulse {
    animation: chatPulse 2s ease-in-out 1;
}

@keyframes chatPulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2); }
    50% { transform: scale(1.1); box-shadow: 0 6px 30px rgba(224, 114, 96, 0.4); }
}

/* === Panneau chat === */
.chat-panel {
    position: absolute;
    bottom: calc(var(--chat-bubble-size) + 12px);
    width: var(--chat-panel-width);
    height: var(--chat-panel-height);
    max-height: 80vh;
    background: var(--chat-bg);
    border-radius: var(--chat-radius);
    box-shadow: var(--chat-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    transform-origin: bottom right;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid var(--chat-border);
}

.chat-widget--bottom-right .chat-panel {
    right: 0;
    transform-origin: bottom right;
}

.chat-widget--bottom-left .chat-panel {
    left: 0;
    transform-origin: bottom left;
}

.chat-panel[hidden] {
    display: none;
}

.chat-panel.chat-panel--open {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* === Header === */
.chat-header {
    background: var(--chat-accent);
    color: var(--chat-text-on-color);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-header-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-header-title {
    font-weight: 700;
    font-size: 15px;
}

.chat-header-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

.chat-status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
}

.chat-status--online { background: #4ade80; }
.chat-status--offline { background: #f87171; }

.chat-close {
    background: none;
    border: none;
    color: var(--chat-text-on-color);
    cursor: pointer;
    padding: 4px;
    border-radius: var(--chat-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Drag handle (mobile) */
.chat-drag-handle {
    display: none;
    text-align: center;
    padding: 6px 0;
    cursor: grab;
    flex-shrink: 0;
}

.chat-drag-handle span {
    display: inline-block;
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--chat-border);
}

/* === Zone messages === */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
}

.chat-messages:focus-visible {
    outline: 2px solid var(--chat-accent);
    outline-offset: -2px;
}

/* Message wrapper */
.chat-msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: chatMsgIn 0.3s ease;
}

@keyframes chatMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-msg--bot,
.chat-msg--referent {
    align-self: flex-start;
}

.chat-msg--visitor {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-msg--system {
    align-self: center;
    max-width: 100%;
}

/* Avatar */
.chat-msg-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    margin-top: 2px;
}

.chat-msg--bot .chat-msg-avatar {
    background: var(--chat-bg-subtle);
}

.chat-msg--referent .chat-msg-avatar {
    background: var(--primary-light, #EDEAFC);
    color: var(--primary, #7B6FCC);
    font-weight: 700;
    font-size: 12px;
}

/* Bulle message */
.chat-msg-bubble {
    padding: 10px 14px;
    border-radius: 16px;
    word-break: break-word;
}

.chat-msg--bot .chat-msg-bubble {
    background: var(--chat-bg-subtle);
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
}

.chat-msg--visitor .chat-msg-bubble {
    background: var(--chat-accent);
    color: var(--chat-text-on-color);
    border-bottom-right-radius: 4px;
}

.chat-msg--referent .chat-msg-bubble {
    background: var(--primary-light, #EDEAFC);
    color: var(--chat-text);
    border-bottom-left-radius: 4px;
}

.chat-msg--system .chat-msg-bubble {
    background: none;
    color: var(--chat-text-muted);
    font-size: 12px;
    font-style: italic;
    text-align: center;
    padding: 4px 8px;
}

/* Horodatage */
.chat-msg-time {
    font-size: 11px;
    color: var(--chat-text-muted);
    margin-top: 2px;
    padding: 0 4px;
}

.chat-msg--visitor .chat-msg-time {
    text-align: right;
}

/* === Boutons FAQ === */
.chat-faq-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 4px 0;
}

.chat-faq-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--chat-accent);
    background: transparent;
    color: var(--chat-accent);
    font-family: var(--chat-font);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    line-height: 1.3;
}

.chat-faq-btn:hover {
    background: var(--chat-accent);
    color: var(--chat-text-on-color);
    transform: translateY(-1px);
}

.chat-faq-btn:focus-visible {
    outline: 3px solid var(--chat-accent);
    outline-offset: 2px;
}

.chat-faq-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.chat-faq-btn-icon {
    font-size: 16px;
    flex-shrink: 0;
}

/* === Carte ressource === */
.chat-resource-card {
    background: var(--chat-bg);
    border: 1px solid var(--chat-border);
    border-radius: var(--chat-radius-sm);
    padding: 10px 14px;
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transition: box-shadow 0.2s;
}

.chat-resource-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.chat-resource-card-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--chat-text);
}

.chat-resource-card-desc {
    font-size: 12px;
    color: var(--chat-text-secondary);
}

.chat-resource-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--chat-accent);
    font-weight: 600;
}

.chat-resource-card a {
    color: var(--chat-accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
}

.chat-resource-card a:hover {
    text-decoration: underline;
}

/* === Lien dans le chat === */
.chat-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--chat-accent);
    text-decoration: none;
    font-weight: 600;
}

.chat-link:hover {
    text-decoration: underline;
}

.chat-msg--visitor .chat-link {
    color: var(--chat-text-on-color);
    text-decoration: underline;
}

/* === Typing indicator === */
.chat-typing {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 16px 8px;
    font-size: 12px;
    color: var(--chat-text-muted);
}

.chat-typing[hidden] {
    display: none;
}

.chat-typing-dots {
    display: inline-flex;
    gap: 3px;
}

.chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--chat-text-muted);
    animation: chatTypingBounce 1.4s infinite ease-in-out;
}

.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chatTypingBounce {
    0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
    40% { transform: translateY(-4px); opacity: 1; }
}

/* === Zone saisie === */
.chat-input-area {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--chat-border);
    background: var(--chat-bg);
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    padding: 8px 14px;
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    background: var(--chat-bg-subtle);
    color: var(--chat-text);
    font-family: var(--chat-font);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.chat-input:focus {
    border-color: var(--chat-accent);
}

.chat-input::placeholder {
    color: var(--chat-text-muted);
}

.chat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--chat-accent);
    color: var(--chat-text-on-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
}

.chat-send-btn:hover {
    background: var(--chat-accent-hover);
    transform: scale(1.05);
}

.chat-send-btn:focus-visible {
    outline: 3px solid var(--chat-accent);
    outline-offset: 2px;
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Input pseudo */
.chat-pseudo-input {
    display: flex;
    gap: 8px;
    padding: 8px 0;
}

.chat-pseudo-input input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--chat-border);
    border-radius: 20px;
    font-family: var(--chat-font);
    font-size: 13px;
    color: var(--chat-text);
    background: var(--chat-bg);
}

.chat-pseudo-input button {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--chat-accent);
    color: var(--chat-text-on-color);
    border: none;
    cursor: pointer;
    font-family: var(--chat-font);
    font-weight: 600;
    font-size: 13px;
}

/* === Noscript fallback === */
.chat-noscript {
    background: var(--bg-subtle, #F3F1EE);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem auto;
    max-width: 600px;
}

.chat-noscript h2 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}

.chat-noscript-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 1rem;
}

.chat-noscript-list a {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--accent, #E07260);
    color: var(--accent, #E07260);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.chat-noscript-list a:hover {
    background: var(--accent, #E07260);
    color: #fff;
}

/* =============================================
   DARK MODE
   ============================================= */
[data-theme="dark"] .chat-widget {
    --chat-bg: var(--bg-card, #222236);
    --chat-bg-subtle: var(--bg-subtle, #2A2A42);
    --chat-text: var(--text, #E8E8ED);
    --chat-text-secondary: var(--text-secondary, #A0A0B4);
    --chat-text-muted: var(--text-muted, #7A7A90);
    --chat-border: rgba(255, 255, 255, 0.1);
    --chat-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .chat-msg--bot .chat-msg-bubble {
    background: var(--chat-bg-subtle);
}

[data-theme="dark"] .chat-resource-card {
    background: var(--chat-bg-subtle);
    border-color: var(--chat-border);
}

[data-theme="dark"] .chat-faq-btn {
    border-color: var(--chat-accent);
    color: var(--chat-accent);
}

[data-theme="dark"] .chat-input {
    background: var(--chat-bg-subtle);
    border-color: var(--chat-border);
    color: var(--chat-text);
}

[data-theme="dark"] .chat-bubble-badge {
    border-color: var(--chat-bg);
}

/* =============================================
   MOBILE (< 480px)
   ============================================= */
@media (max-width: 480px) {
    .chat-widget {
        --chat-bubble-size: 48px;
        bottom: 16px;
    }

    .chat-widget--bottom-right { right: 16px; }
    .chat-widget--bottom-left { left: 16px; }

    .chat-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 70vh;
        max-height: 85vh;
        border-radius: var(--chat-radius) var(--chat-radius) 0 0;
        transform-origin: bottom center;
    }

    .chat-panel.chat-panel--open {
        transform: translateY(0);
    }

    .chat-drag-handle {
        display: block;
    }

    .chat-bubble-icon {
        width: 20px;
        height: 20px;
    }

    .chat-faq-btn {
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* =============================================
   TABLETTE (481px - 768px)
   ============================================= */
@media (min-width: 481px) and (max-width: 768px) {
    .chat-widget {
        --chat-panel-width: 340px;
        --chat-panel-height: 450px;
    }
}

/* =============================================
   REDUCED MOTION
   ============================================= */
@media (prefers-reduced-motion: reduce) {
    .chat-bubble,
    .chat-panel,
    .chat-msg,
    .chat-faq-btn,
    .chat-send-btn {
        transition: none !important;
        animation: none !important;
    }

    .chat-typing-dots span {
        animation: none;
        opacity: 0.6;
    }

    .chat-bubble--pulse {
        animation: none !important;
    }
}

/* =============================================
   ADMIN : Styles Chat Référent
   ============================================= */
.chat-admin-layout {
    display: grid;
    grid-template-columns: 300px 1fr 280px;
    gap: 0;
    height: calc(100vh - 64px);
    background: var(--bg, #FAF9F7);
}

.chat-admin-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border, #E8E6E1);
}

.chat-admin-col:last-child {
    border-right: none;
}

/* Colonne gauche : liste conversations */
.chat-admin-list {
    overflow-y: auto;
}

.chat-admin-tabs {
    display: flex;
    border-bottom: 1px solid var(--border, #E8E6E1);
    background: var(--bg-card, #fff);
    position: sticky;
    top: 0;
    z-index: 1;
}

.chat-admin-tab {
    flex: 1;
    padding: 10px 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-secondary, #6B7280);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.chat-admin-tab.active {
    color: var(--accent, #E07260);
    border-bottom-color: var(--accent, #E07260);
}

.chat-admin-tab .badge-notif {
    margin-left: 4px;
}

.chat-conv-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--divider, #F0EDE8);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-conv-item:hover {
    background: var(--bg-subtle, #F3F1EE);
}

.chat-conv-item.active {
    background: var(--primary-light, #EDEAFC);
    border-left: 3px solid var(--accent, #E07260);
}

.chat-conv-item--waiting {
    background: var(--warning-bg, #FEF3E2);
}

.chat-conv-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-conv-item-pseudo {
    font-weight: 600;
    font-size: 14px;
}

.chat-conv-item-time {
    font-size: 11px;
    color: var(--text-muted, #9CA3AF);
}

.chat-conv-item-preview {
    font-size: 12px;
    color: var(--text-secondary, #6B7280);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-conv-item-meta {
    font-size: 11px;
    color: var(--text-muted, #9CA3AF);
    display: flex;
    gap: 8px;
}

.badge-notif {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--danger, #D97B7B);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

/* Colonne centre : conversation */
.chat-admin-conversation {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-card, #fff);
}

.chat-admin-conv-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, #E8E6E1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.chat-admin-conv-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-admin-conv-input {
    padding: 12px 16px;
    border-top: 1px solid var(--border, #E8E6E1);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.chat-admin-conv-input input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border, #E8E6E1);
    border-radius: 20px;
    font-size: 14px;
    font-family: var(--font-body, sans-serif);
    color: var(--text, #2B2D42);
    background: var(--bg-subtle, #F3F1EE);
}

.chat-admin-conv-input input:focus {
    outline: none;
    border-color: var(--accent, #E07260);
}

.chat-admin-conv-actions {
    display: flex;
    gap: 6px;
}

/* Colonne droite : contexte */
.chat-admin-context {
    padding: 16px;
    overflow-y: auto;
    background: var(--bg, #FAF9F7);
}

.chat-admin-context h3 {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
}

.chat-admin-context-item {
    margin-bottom: 12px;
}

.chat-admin-context-item label {
    display: block;
    font-size: 11px;
    color: var(--text-muted, #9CA3AF);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}

.chat-admin-context-item span {
    font-size: 13px;
    color: var(--text, #2B2D42);
}

/* Réponses rapides */
.chat-admin-quick-replies {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
}

.chat-admin-quick-replies h4 {
    font-size: 12px;
    color: var(--text-muted, #9CA3AF);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 8px;
}

.chat-admin-quick-reply {
    padding: 6px 10px;
    border-radius: var(--radius-sm, 8px);
    border: 1px solid var(--border, #E8E6E1);
    background: var(--bg-card, #fff);
    font-size: 12px;
    cursor: pointer;
    text-align: left;
    color: var(--text, #2B2D42);
    transition: all 0.2s;
    font-family: var(--font-body, sans-serif);
}

.chat-admin-quick-reply:hover {
    border-color: var(--accent, #E07260);
    background: var(--accent-light, #FDE8E4);
}

/* Bandeau notification */
.chat-admin-banner {
    background: var(--warning-bg, #FEF3E2);
    border-bottom: 1px solid var(--warning, #E6A64E);
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #2B2D42);
}

.chat-admin-banner a {
    color: var(--accent, #E07260);
    font-weight: 700;
    text-decoration: none;
}

.chat-admin-banner a:hover {
    text-decoration: underline;
}

/* Empty state */
.chat-admin-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
    color: var(--text-muted, #9CA3AF);
}

.chat-admin-empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

/* === FAQ Admin : Arbre visuel === */
.faq-tree {
    padding: 16px;
}

.faq-tree-node {
    margin: 4px 0;
}

.faq-tree-node-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-sm, 8px);
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.faq-tree-node-header:hover {
    background: var(--bg-subtle, #F3F1EE);
}

.faq-tree-node-header.dragging {
    opacity: 0.5;
}

.faq-tree-toggle {
    width: 20px;
    font-size: 12px;
    color: var(--text-muted, #9CA3AF);
    cursor: pointer;
    transition: transform 0.2s;
    background: none;
    border: none;
    padding: 0;
}

.faq-tree-toggle.open {
    transform: rotate(90deg);
}

.faq-tree-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.faq-type-question { background: #DBEAFE; color: #1D4ED8; }
.faq-type-reponse { background: #D1FAE5; color: #065F46; }
.faq-type-lien_ressource,
.faq-type-lien_thematique,
.faq-type-lien_externe { background: #EDE9FE; color: #5B21B6; }
.faq-type-contact_humain { background: #FFEDD5; color: #C2410C; }

.faq-tree-label {
    flex: 1;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.faq-tree-btn {
    font-size: 12px;
}

.faq-tree-stats {
    font-size: 11px;
    color: var(--text-muted, #9CA3AF);
}

.faq-tree-children {
    margin-left: 28px;
    border-left: 1px dashed var(--border, #E8E6E1);
    padding-left: 12px;
}

.faq-tree-children.collapsed {
    display: none;
}

.faq-node--disabled {
    opacity: 0.5;
}

.faq-node--disabled .faq-tree-node-header {
    background: var(--bg-subtle, #F3F1EE);
}

/* Responsive admin chat */
@media (max-width: 768px) {
    .chat-admin-layout {
        grid-template-columns: 1fr;
        height: auto;
    }

    .chat-admin-col:nth-child(3) {
        display: none;
    }

    .chat-admin-col {
        border-right: none;
    }

    .chat-admin-col--hidden-mobile {
        display: none;
    }
}

@media (max-width: 1024px) {
    .chat-admin-layout {
        grid-template-columns: 260px 1fr;
    }

    .chat-admin-col:nth-child(3) {
        display: none;
    }
}
