/* ============================================================
   SERVICE CLIENT IA — FEUILLE DE STYLE RESPONSIVE
   Design mobile-first, compatible desktop / tablette / mobile
   ============================================================ */

/* ---- RESET & BASE ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary: #1e3a5f;
    --primary-light: #2d6a9f;
    --primary-ultra-light: #e8f0fb;
    --accent: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 24px rgba(0,0,0,0.12);
    --navbar-h: 64px;
    --transition: 0.2s ease;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- NAVBAR ---- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: var(--primary);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.navbar-brand {
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
    flex-shrink: 0;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: none;
}
.navbar-links::-webkit-scrollbar { display: none; }

.nav-link {
    color: rgba(255,255,255,0.8);
    padding: 0.45rem 0.85rem;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    transition: background var(--transition), color var(--transition);
}
.nav-link:hover { background: rgba(255,255,255,0.15); color: white; text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,0.2); color: white; font-weight: 600; }

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
    margin-left: auto;
}

.user-badge {
    font-size: 0.82rem;
    color: rgba(255,255,255,0.9);
    white-space: nowrap;
}
.user-badge small { opacity: 0.7; }
.user-badge.role-admin { color: #93c5fd; }
.user-badge.role-collaborateur { color: #6ee7b7; }

.btn-logout {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    text-decoration: none;
    transition: background var(--transition);
    white-space: nowrap;
}
.btn-logout:hover { background: rgba(255,255,255,0.25); text-decoration: none; }

/* Menu hamburger mobile */
.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    flex-shrink: 0;
}

/* ---- MAIN CONTENT ---- */
.main-content {
    margin-top: var(--navbar-h);
    padding: 1.5rem;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
    margin-top: calc(var(--navbar-h) + 1.5rem);
}

/* ---- CARDS ---- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---- STATS GRID ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    text-align: center;
    transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon { font-size: 1.8rem; margin-bottom: 0.4rem; }
.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }

/* ---- BOUTONS ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity var(--transition), transform var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { opacity: 0.88; transform: translateY(-1px); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: white; }
.btn-accent { background: var(--accent); color: white; }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }

/* ---- FORMULAIRES ---- */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text);
    background: white;
    transition: border-color var(--transition);
    outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    border-color: var(--accent);
}

/* ---- TAGS ---- */
.tag-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tag-badge.public { background: #dbeafe; color: #1d4ed8; }
.tag-badge.interne { background: #fce7f3; color: #9d174d; }
.tag-badge.admin { background: #fef3c7; color: #92400e; }
.tag-badge.collaborateur { background: #d1fae5; color: #065f46; }
.tag-badge.commercial { background: #ede9fe; color: #6d28d9; }

/* ---- TABLES ---- */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th { background: var(--bg); color: var(--text-muted); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.75rem 1rem; text-align: left; }
td { padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--primary-ultra-light); }

/* ---- CHATBOT ---- */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--navbar-h) - 3rem);
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.chat-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.chat-header h2 { font-size: 1rem; font-weight: 700; margin: 0; }
.chat-header p { font-size: 0.8rem; opacity: 0.8; margin: 0.15rem 0 0; }
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    scroll-behavior: smooth;
}
.message { display: flex; max-width: 80%; }
.message.user-message { align-self: flex-end; flex-direction: row-reverse; }
.message.bot-message { align-self: flex-start; }
.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: 16px;
    font-size: 0.92rem;
    line-height: 1.55;
    word-break: break-word;
}
.user-message .message-bubble {
    background: var(--primary);
    color: white;
    border-bottom-right-radius: 4px;
}
.bot-message .message-bubble {
    background: var(--bg);
    color: var(--text);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border);
}
.message-bubble.typing { opacity: 0.6; font-style: italic; }
.message-source {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    padding: 0 0.25rem;
}
.chat-input-area {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    background: white;
    flex-shrink: 0;
}
.chat-input-area textarea {
    flex: 1;
    resize: none;
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 0.65rem 0.9rem;
    font-size: 0.95rem;
    font-family: inherit;
    max-height: 120px;
    outline: none;
    transition: border-color var(--transition);
    line-height: 1.5;
}
.chat-input-area textarea:focus { border-color: var(--accent); }
.btn-send {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 0.65rem 1.1rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background var(--transition);
    flex-shrink: 0;
    align-self: flex-end;
}
.btn-send:hover { background: var(--primary-light); }
.btn-send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- MODALES ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    width: 100%;
    max-width: 500px;
    box-shadow: var(--shadow-md);
    max-height: 90vh;
    overflow-y: auto;
}
.modal h3 { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin-bottom: 1rem; }
.modal-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; flex-wrap: wrap; }

/* ---- FILTRES ---- */
.filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filter-btn {
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: white;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
}
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: var(--accent); border-color: var(--accent); color: white; }

/* ---- DRAG & DROP ---- */
.drop-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg);
}
.drop-area:hover, .drop-area.dragover {
    border-color: var(--accent);
    background: var(--primary-ultra-light);
}
.drop-area .drop-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.drop-area p { color: var(--text-muted); font-size: 0.9rem; margin: 0.25rem 0; }

/* ---- PROGRESS BAR ---- */
.progress-bar { background: var(--bg); border-radius: 20px; height: 8px; overflow: hidden; margin: 0.75rem 0; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--success)); border-radius: 20px; transition: width 0.4s ease; width: 0%; }

/* ---- ALERTS ---- */
.alert { padding: 0.85rem 1rem; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 1rem; }
.alert-success { background: #d1fae5; color: #065f46; border-left: 4px solid var(--success); }
.alert-error { background: #fee2e2; color: #991b1b; border-left: 4px solid var(--danger); }
.alert-info { background: var(--primary-ultra-light); color: var(--primary); border-left: 4px solid var(--accent); }

/* ---- CONVERSATIONS ---- */
.conv-layout { display: grid; grid-template-columns: 320px 1fr; gap: 1.5rem; height: calc(100vh - var(--navbar-h) - 3rem); }
.conv-list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-y: auto; }
.conv-item { padding: 1rem 1.25rem; border-bottom: 1px solid var(--border); cursor: pointer; transition: background var(--transition); }
.conv-item:hover { background: var(--primary-ultra-light); }
.conv-item.selected { background: var(--primary-ultra-light); border-left: 3px solid var(--accent); }
.conv-meta { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.conv-detail { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-y: auto; padding: 1.5rem; }

/* ---- PAGE TITRE ---- */
.page-header { margin-bottom: 1.5rem; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.page-header h1 { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.page-header p { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ---- UTILISATEURS ---- */
.user-avatar { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }
.user-avatar.admin { background: #dbeafe; color: #1d4ed8; }
.user-avatar.collaborateur { background: #d1fae5; color: #065f46; }
.user-avatar.commercial { background: #ede9fe; color: #6d28d9; }

/* ============================================================
   RESPONSIVE — TABLETTE (max 1024px)
   ============================================================ */
@media (max-width: 1024px) {
    .conv-layout { grid-template-columns: 260px 1fr; }
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   RESPONSIVE — MOBILE (max 768px)
   ============================================================ */
@media (max-width: 768px) {
    :root { --navbar-h: 56px; }

    /* Navbar mobile */
    .navbar { padding: 0 1rem; flex-wrap: wrap; height: auto; min-height: var(--navbar-h); }
    .navbar-brand { font-size: 1rem; }
    .navbar-toggle { display: block; }
    .navbar-links {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 0.5rem 0 1rem;
        gap: 0.1rem;
    }
    .navbar-links.open { display: flex; }
    .nav-link { padding: 0.6rem 0.75rem; font-size: 0.95rem; }
    .navbar-user { width: 100%; padding-bottom: 0.75rem; justify-content: space-between; }
    .user-badge small { display: none; }

    /* Main */
    .main-content { padding: 1rem; margin-top: calc(var(--navbar-h) + 1rem); }

    /* Stats */
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
    .stat-value { font-size: 1.6rem; }

    /* Chat */
    .chat-container { height: calc(100vh - var(--navbar-h) - 2rem); border-radius: var(--radius-sm); }
    .message { max-width: 92%; }
    .chat-input-area { padding: 0.75rem; }

    /* Conversations */
    .conv-layout { grid-template-columns: 1fr; height: auto; }
    .conv-list { max-height: 300px; }
    .conv-detail { min-height: 400px; }

    /* Tables */
    table { font-size: 0.82rem; }
    th, td { padding: 0.6rem 0.75rem; }

    /* Modales */
    .modal { padding: 1.5rem; }
    .modal-actions { flex-direction: column-reverse; }
    .modal-actions .btn { width: 100%; justify-content: center; }

    /* Page header */
    .page-header { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   RESPONSIVE — PETIT MOBILE (max 480px)
   ============================================================ */
@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.4rem; }
    .stat-icon { font-size: 1.4rem; }
    .card { padding: 1rem; }
    .btn { padding: 0.55rem 1rem; font-size: 0.85rem; }
    .message { max-width: 96%; }
    .chat-header { padding: 0.75rem 1rem; }
    .chat-header h2 { font-size: 0.95rem; }
}

/* ---- NAVIGATION (v4 — hamburger mobile) ---- */

/* Navbar */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--navbar-h);
    background: var(--primary);
    display: flex;
    align-items: center;
    padding: 0 1rem;
    gap: 0.75rem;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

/* Marque */
.nav-brand {
    display: flex; align-items: center; gap: 0.5rem;
    color: white; font-weight: 700; font-size: 1rem;
    text-decoration: none; flex-shrink: 0;
}
.nav-brand-text { display: none; }
.nav-icon { font-size: 1.3rem; }

/* Bouton hamburger — visible sur mobile, caché sur desktop */
.nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
    margin-left: auto;
    flex-shrink: 0;
    line-height: 1;
}
.nav-toggle:hover { background: rgba(255,255,255,0.15); }
.hamburger-icon { display: block; line-height: 1; }

/* Liens de navigation — masqués par défaut (mobile-first) */
.nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: var(--navbar-h);
    left: 0; right: 0;
    background: var(--primary);
    padding: 0.5rem 0 1rem;
    border-top: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    z-index: 999;
    max-height: calc(100vh - var(--navbar-h));
    overflow-y: auto;
}
.nav-links.open { display: flex; }

.nav-link {
    color: rgba(255,255,255,0.85);
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}
.nav-link:hover { background: rgba(255,255,255,0.1); color: white; text-decoration: none; }
.nav-link.active { background: rgba(255,255,255,0.15); color: white; font-weight: 700; border-left-color: #93c5fd; }
.nav-link-icon { font-size: 1rem; flex-shrink: 0; }

/* Section utilisateur dans le menu mobile */
.nav-user-mobile {
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}
.nav-user-mobile .nav-user-role {
    color: rgba(255,255,255,0.6);
    font-size: 0.8rem;
    padding: 0.4rem 1.25rem;
}
.nav-link-logout { color: #fca5a5 !important; }
.nav-link-logout:hover { background: rgba(239,68,68,0.15) !important; }

/* Infos utilisateur desktop */
.nav-user-desktop {
    display: none;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    margin-left: auto;
}
.user-avatar-circle {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.nav-user-info { display: flex; flex-direction: column; align-items: flex-end; }
.nav-user-name { color: white; font-size: 0.82rem; font-weight: 600; }
.nav-user-role-badge {
    font-size: 0.7rem;
    padding: 0.1rem 0.45rem;
    border-radius: 20px;
    font-weight: 600;
}
.nav-user-role-badge.admin { background: rgba(147,197,253,0.2); color: #93c5fd; }
.nav-user-role-badge.collaborateur { background: rgba(110,231,183,0.2); color: #6ee7b7; }

/* Btn logout */
.btn-logout {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 0.3rem 0.4rem;
    border-radius: 6px;
    transition: all 0.2s;
    background: none;
}
.btn-logout:hover { color: white; background: rgba(255,255,255,0.15); text-decoration: none; }

/* Widget chatbot client (externe) */
.chat-widget-btn {
    position: fixed;
    bottom: 1.5rem; right: 1.5rem;
    width: 58px; height: 58px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(30,58,95,0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 9999;
    display: flex; align-items: center; justify-content: center;
}
.chat-widget-btn:hover { transform: scale(1.08); box-shadow: 0 6px 25px rgba(30,58,95,0.5); }

.chat-widget-window {
    position: fixed;
    bottom: 5rem; right: 1.5rem;
    width: 360px; max-height: 520px;
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    display: flex; flex-direction: column;
    overflow: hidden;
    z-index: 9998;
    transition: all 0.3s ease;
}
.chat-widget-window.hidden { opacity: 0; pointer-events: none; transform: translateY(20px) scale(0.95); }

.widget-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white; padding: 1rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.widget-header-info h3 { font-size: 0.95rem; font-weight: 700; margin: 0; }
.widget-header-info p { font-size: 0.78rem; opacity: 0.8; margin: 0.1rem 0 0; }
.widget-close { background: none; border: none; color: white; font-size: 1.2rem; cursor: pointer; opacity: 0.8; }
.widget-close:hover { opacity: 1; }

.widget-messages {
    flex: 1; overflow-y: auto; padding: 1rem;
    display: flex; flex-direction: column; gap: 0.65rem;
    background: #f8fafc;
}
.widget-msg { max-width: 85%; }
.widget-msg.user { align-self: flex-end; }
.widget-msg.bot { align-self: flex-start; }
.widget-bubble { padding: 0.6rem 0.85rem; border-radius: 12px; font-size: 0.88rem; line-height: 1.5; }
.widget-msg.user .widget-bubble { background: var(--primary); color: white; border-bottom-right-radius: 4px; }
.widget-msg.bot .widget-bubble { background: white; border: 1px solid var(--border); color: var(--text); border-bottom-left-radius: 4px; }
.widget-msg.bot .widget-bubble.typing { opacity: 0.6; font-style: italic; }

.widget-input-area {
    padding: 0.75rem; border-top: 1px solid var(--border);
    display: flex; gap: 0.5rem; background: white; flex-shrink: 0;
}
.widget-input-area input {
    flex: 1; border: 1.5px solid var(--border); border-radius: 8px;
    padding: 0.5rem 0.75rem; font-size: 0.88rem; outline: none;
    transition: border-color 0.2s;
}
.widget-input-area input:focus { border-color: var(--accent); }
.widget-input-area button {
    background: var(--primary); color: white; border: none;
    border-radius: 8px; padding: 0.5rem 0.85rem;
    cursor: pointer; font-size: 0.9rem; transition: background 0.2s;
}
.widget-input-area button:hover { background: var(--primary-light); }
.widget-input-area button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 420px) {
    .chat-widget-window { width: calc(100vw - 2rem); right: 1rem; }
}

/* Desktop nav (≥1024px) */
@media (min-width: 1024px) {
    /* Cacher le bouton hamburger sur desktop */
    .nav-toggle { display: none !important; }

    /* Afficher le nom de la marque */
    .nav-brand-text { display: inline; }

    /* Les liens de navigation en ligne horizontale */
    .nav-links {
        display: flex !important;
        flex-direction: row;
        position: static;
        background: none;
        padding: 0;
        border: none;
        box-shadow: none;
        flex: 1;
        gap: 0.1rem;
        max-height: none;
        overflow: visible;
    }
    .nav-link {
        padding: 0.4rem 0.75rem;
        border-radius: 6px;
        border-left: none;
        font-size: 0.88rem;
    }
    .nav-link.active { border-left: none; }

    /* Cacher la section mobile utilisateur dans le menu desktop */
    .nav-user-mobile { display: none !important; }

    /* Afficher les infos utilisateur desktop */
    .nav-user-desktop { display: flex; }
    .nav-user-info { display: flex; }
}

/* ---- UTILITAIRES ---- */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.hidden { display: none !important; }
