/* ============================================ */
/* RESET ET VARIABLES */
/* ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Couleurs principales */
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: #EEF2FF;
    --secondary-color: #6B7280;
    --success-color: #10B981;
    --error-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;

    /* Thème clair (défaut) */
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --background: #F9FAFB;
    --surface: #FFFFFF;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --border-color: #E5E7EB;
    --card-bg: #ffffff;
    --sidebar-bg: #f9fafb;
    --hover-bg: #f3f4f6;
    --header-bg: #ffffff;
    --input-bg: #ffffff;
    --input-border: #e5e7eb;
    --link-color: #4f46e5;
    --link-hover: #4338ca;

    /* Icônes statistiques */
    --stat-icon-blue: #dbeafe;
    --stat-icon-green: #d1fae5;
    --stat-icon-orange: #fed7aa;
    --stat-icon-purple: #ede9fe;

    /* Layout */
    --sidebar-width: 260px;

    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ============================================ */
/* THÈME SOMBRE */
/* ============================================ */
.theme-dark {
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --background: #111827;
    --surface: #1f2937;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --card-bg: #1f2937;
    --sidebar-bg: #111827;
    --hover-bg: #374151;
    --stat-icon-blue: #1e3a8a;
    --stat-icon-green: #065f46;
    --stat-icon-orange: #92400e;
    --stat-icon-purple: #5b21b6;
    --header-bg: #1f2937;
    --input-bg: #374151;
    --input-border: #4b5563;
    --link-color: #818cf8;
    --link-hover: #a5b4fc;
}

/* ============================================ */
/* BASE */
/* ============================================ */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================ */
/* SIDEBAR */
/* ============================================ */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-header .logo {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-item svg {
    width: 20px;
    height: 20px;
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.nav-item.active {
    background: var(--primary-color);
    color: white;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.logout-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: var(--error-color);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn svg {
    width: 20px;
    height: 20px;
}

.logout-btn:hover {
    background: #FEE2E2;
}

/* ============================================ */
/* CONTENU PRINCIPAL */
/* ============================================ */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 32px;
    min-height: 100vh;
    background-color: var(--bg-primary);
}

.container {
    padding: 40px 50px;
}

/* ============================================ */
/* HEADER */
/* ============================================ */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
}

.header-left h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-subtitle {
    font-size: 15px;
    color: var(--text-secondary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ============================================ */
/* STATS */
/* ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background-color: var(--card-bg);
    padding: 24px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    display: flex;
    gap: 16px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    border-color: var(--border-color);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

/* Les gradients remplacent les variables de couleur plate pour les icônes stat */
.stat-icon.blue {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-icon.green {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8B5CF6 0%, #7C3AED 100%);
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.stat-change {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--error-color);
}

/* ============================================ */
/* SECTIONS DE CONTENU */
/* ============================================ */
.content-section {
    background-color: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ============================================ */
/* BOUTONS */
/* ============================================ */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary svg {
    width: 18px;
    height: 18px;
}

.btn-secondary {
    flex: 1;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--hover-bg);
}

.btn-danger {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #FEE2E2;
    color: var(--error-color);
}

.btn-danger:hover {
    background: var(--error-color);
    color: white;
}

.btn-settings {
    padding: 8px 14px;
    font-size: 14px;
    background: #6366f1;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-settings:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-continue {
    background-color: #f59e0b;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background-color 0.2s;
}

.btn-continue:hover {
    background-color: #d97706;
}

.btn-delete {
    background-color: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: background-color 0.2s;
}

.btn-delete:hover {
    background-color: #dc2626;
}

.link-text {
    color: var(--link-color);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.link-text:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

/* ============================================ */
/* AGENTS — GRILLE ET CARTES */
/* ============================================ */
.agents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.agent-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.agent-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.agent-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 16px;
}

.agent-info {
    flex: 1;
}

.agent-info h3,
.agent-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.agent-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.agent-details {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.agent-model {
    background-color: #e0e7ff;
    color: #3730a3;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 13px;
}

.theme-dark .agent-model {
    background-color: #374151;
    color: #a5b4fc;
}

.agent-date {
    color: var(--text-secondary);
    font-size: 13px;
}

.agent-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.agent-status.active {
    background: #D1FAE5;
    color: #065F46;
}

.agent-status.inactive {
    background: #FEE2E2;
    color: #991B1B;
}

.agent-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.agent-stat {
    flex: 1;
}

.agent-stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.agent-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.agent-actions {
    display: flex;
    gap: 8px;
}

/* ============================================ */
/* AGENTS — LISTE */
/* ============================================ */
.agents-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.agent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    gap: 16px;
}

.agent-item:hover {
    border-color: var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ✅ Avatar agent — cohérent avec statistics.html / settings.html */
.agent-item-main {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.agent-avatar-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #eef2ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

/* ============================================ */
/* AGENTS — TABLEAU */
/* ============================================ */
.page-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 25px;
    color: var(--text-primary);
}

.agents-table {
    width: 100%;
    border-collapse: collapse;
    background-color: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.agents-table thead {
    background-color: var(--bg-secondary);
}

.agents-table th {
    text-align: left;
    padding: 14px 18px;
    font-size: 14px;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.agents-table td {
    padding: 18px;
    font-size: 15px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.agents-table tr:hover {
    background-color: var(--hover-bg);
}

/* ============================================ */
/* BADGES STATUT */
/* ============================================ */
.badge-active {
    padding: 6px 12px;
    border-radius: 20px;
    background: #d1fae5;
    color: #065f46;
    font-size: 13px;
    font-weight: 600;
}

.badge-inactive {
    padding: 6px 12px;
    border-radius: 20px;
    background: #fee2e2;
    color: #991b1b;
    font-size: 13px;
    font-weight: 600;
}

/* ============================================ */
/* STATUS TOGGLE (SLIDER ON/OFF) */
/* ============================================ */
.toggle-slider-container {
    width: 70px;
    height: 30px;
    position: relative;
    user-select: none;
}

.toggle-slider {
    cursor: pointer;
    position: relative;
    width: 100%;
    height: 100%;
}

.slider-track {
    width: 100%;
    height: 30px;
    background-color: #ef4444;
    border-radius: 15px;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease;
}

.toggle-slider.active .slider-track {
    background-color: #10b981;
}

.toggle-slider:hover .slider-track {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.toggle-slider.inactive:hover .slider-track {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.slider-thumb {
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    cursor: grab;
}

.toggle-slider.active .slider-thumb {
    left: calc(100% - 27px);
    transform: scale(1.1);
}

.slider-thumb:active {
    cursor: grabbing;
    transform: scale(1.2);
}

.toggle-slider.loading .slider-thumb {
    animation: pulse-toggle 1.5s infinite;
}

.slider-labels {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
    z-index: 1;
    pointer-events: none;
}

.slider-labels span {
    color: white;
    font-weight: 600;
    font-size: 12px;
    transition: opacity 0.3s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.label-off { opacity: 1; }
.label-on  { opacity: 0.5; }

.toggle-slider.active .label-off { opacity: 0.5; }
.toggle-slider.active .label-on  { opacity: 1; }

.slider-state {
    text-align: center;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
    transition: color 0.3s ease;
}

.toggle-slider.active .slider-state {
    color: #10b981;
    font-weight: 600;
}

.toggle-slider.inactive .slider-state {
    color: #ef4444;
    font-weight: 600;
}

/* Ancien bouton toggle (compatibilité) */
.status-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border: none;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 85px;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.status-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.status-toggle:hover::before {
    opacity: 1;
}

.status-toggle.active {
    background-color: #10b981;
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.status-toggle.inactive {
    background-color: #ef4444;
    color: white;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.status-toggle:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.status-toggle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.status-toggle:disabled::before {
    display: none;
}

.status-toggle.loading .toggle-text {
    animation: pulse-text 1.5s ease-in-out infinite;
}

.toggle-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-text {
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'Inter', sans-serif;
}

/* ============================================ */
/* ACTIVITÉ */
/* ============================================ */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s;
}

.activity-item:hover {
    background-color: var(--hover-bg);
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon svg {
    width: 20px;
    height: 20px;
    color: white;
}

.activity-icon.success {
    background-color: #d1fae5;
    color: #10b981;
}

.activity-icon.warning {
    background-color: #fee2e2;
    color: #ef4444;
}

.activity-icon.info {
    background-color: #dbeafe;
    color: #3b82f6;
}

.theme-dark .activity-icon.success {
    background-color: #065f46;
    color: #10b981;
}

.theme-dark .activity-icon.warning {
    background-color: #92400e;
    color: #f59e0b;
}

.theme-dark .activity-icon.info {
    background-color: #1e3a8a;
    color: #3b82f6;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.activity-description {
    font-size: 14px;
    color: var(--text-secondary);
}

.activity-time {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

/* ============================================ */
/* AGENTS EN ATTENTE */
/* ============================================ */
.pending-agents-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.pending-agent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.pending-agent-item:hover {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
}

.theme-dark .pending-agent-item {
    background: #374151;
    border-color: #f59e0b;
}

.pending-agent-info {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.pending-agent-icon {
    width: 40px;
    height: 40px;
    background: #fef3c7;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.pending-agent-content {
    flex: 1;
}

.pending-agent-message {
    font-size: 16px;
    color: #92400e;
    margin-bottom: 4px;
    font-weight: 500;
}

.theme-dark .pending-agent-message {
    color: #fcd34d;
}

.pending-agent-variant {
    background: #f59e0b;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-left: 8px;
}

.pending-agent-date {
    font-size: 12px;
    color: #b45309;
    display: flex;
    align-items: center;
    gap: 4px;
}

.theme-dark .pending-agent-date {
    color: #f59e0b;
}

.pending-agent-actions {
    display: flex;
    gap: 10px;
}

/* ============================================ */
/* WEBHOOK */
/* ============================================ */
.webhook-container {
    margin-top: 8px;
    padding: 10px 12px;
    background-color: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.webhook-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    font-weight: 500;
}

.webhook-url {
    background-color: var(--input-bg);
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--text-primary);
    border: 1px solid var(--input-border);
    font-family: 'Courier New', monospace;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.copy-webhook-btn {
    background-color: #4f46e5;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.2s;
}

.copy-webhook-btn:hover {
    background-color: #4338ca;
}

.copy-webhook-btn:disabled {
    background-color: #10b981;
    cursor: not-allowed;
}

/* ============================================ */
/* MODAL */
/* ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 20px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    background: var(--bg-secondary);
    border: none;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--error-color);
    color: white;
}

.modal-close svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    padding: 24px;
}

.modal-description {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.agent-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.agent-type-card {
    padding: 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.agent-type-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.agent-type-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.agent-type-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.agent-type-description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ============================================ */
/* ÉTAT VIDE */
/* ============================================ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    background-color: var(--card-bg);
    border-radius: 12px;
    border: 2px dashed var(--border-color);
    margin-top: 20px;
}

.empty-state-icon,
.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.empty-state-icon svg,
.empty-icon {
    width: 40px;
    height: 40px;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.empty-state p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-weight: 500;
}

.empty-state-description {
    color: var(--text-secondary);
    font-size: 14px;
}

.empty-message {
    margin-top: 40px;
    font-size: 18px;
    color: var(--text-secondary);
    text-align: center;
}

/* ============================================ */
/* PROFIL UTILISATEUR */
/* ============================================ */
.user-profile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 10px;
    background-color: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.user-dropdown.show {
    display: block;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s;
}

.dropdown-item:hover {
    background-color: var(--hover-bg);
}

.dropdown-item i {
    width: 20px;
    color: var(--text-secondary);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 4px 0;
}

/* ============================================ */
/* NOTIFICATIONS — ICÔNE */
/* ============================================ */
.notifications-dropdown {
    position: relative;
    margin-right: 15px;
}

.notification-icon {
    position: relative;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.notification-icon:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.notification-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
    stroke-width: 2;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.2));
}

.notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    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 white;
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.5);
    animation: pulse-notification 2s infinite;
}

.theme-dark .notification-icon {
    background: linear-gradient(135deg, #6366f1, #818cf8);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.4);
}

.theme-dark .notification-icon:hover {
    background: linear-gradient(135deg, #4f46e5, #6366f1);
    box-shadow: 0 6px 15px rgba(99, 102, 241, 0.6);
}

.theme-dark .notification-badge {
    border-color: #1f2937;
}

/* ============================================ */
/* NOTIFICATIONS — PANNEAU */
/* ============================================ */
.notifications-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 420px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    margin-top: 15px;
    display: none;
    z-index: 1000;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.notifications-panel.show {
    display: block;
    animation: slideDown 0.3s ease;
}

.notifications-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-secondary);
}

.notifications-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.mark-all-read {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
}

.mark-all-read:hover {
    background-color: var(--hover-bg);
    color: #4f46e5;
    transform: scale(1.1);
}

.notifications-list {
    max-height: 520px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.notification-item:hover {
    background-color: var(--hover-bg);
    transform: translateX(5px);
}

.notification-item.unread {
    background: linear-gradient(to right, #f0f9ff, var(--card-bg));
    border-left: 3px solid #4f46e5;
}

.notification-item.unread:hover {
    background: linear-gradient(to right, #e6f2ff, var(--hover-bg));
}

.theme-dark .notification-item.unread {
    background: linear-gradient(to right, #1e3a8a, #1f2937);
    border-left-color: #818cf8;
}

.theme-dark .notification-item.unread:hover {
    background: linear-gradient(to right, #1e40af, #374151);
}

.notification-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    flex-shrink: 0;
    font-size: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.notification-item-icon.info       { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #2563eb; }
.notification-item-icon.success    { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #059669; }
.notification-item-icon.warning    { background: linear-gradient(135deg, #fed7aa, #fcd34d); color: #d97706; }
.notification-item-icon.error      { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #dc2626; }
.notification-item-icon.abonnement { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4f46e5; }
.notification-item-icon.securite   { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #dc2626; }
.notification-item-icon.agent      { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4f46e5; }

.notification-item-content {
    flex: 1;
}

.notification-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-size: 16px;
}

.notification-item-message {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.5;
}

.notification-item-time {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.notification-item-time::before {
    content: "🕐";
    font-size: 11px;
    opacity: 0.7;
}

/* ✅ Modal détail notification */
.notif-detail-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 12000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.notif-detail-overlay.show {
    display: flex;
}

.notif-detail-dialog {
    background: var(--card-bg);
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
}

.notif-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 20px 0 20px;
}

.notif-detail-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.notif-detail-icon.info       { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #2563eb; }
.notif-detail-icon.success    { background: linear-gradient(135deg, #d1fae5, #a7f3d0); color: #059669; }
.notif-detail-icon.warning    { background: linear-gradient(135deg, #fed7aa, #fcd34d); color: #d97706; }
.notif-detail-icon.error      { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #dc2626; }
.notif-detail-icon.abonnement { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4f46e5; }
.notif-detail-icon.securite   { background: linear-gradient(135deg, #fee2e2, #fecaca); color: #dc2626; }
.notif-detail-icon.agent      { background: linear-gradient(135deg, #e0e7ff, #c7d2fe); color: #4f46e5; }

.notif-detail-close {
    background: none;
    border: none;
    font-size: 26px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.notif-detail-close:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.notif-detail-body {
    padding: 16px 20px 24px 20px;
}

.notif-detail-body h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-detail-body p {
    margin: 0 0 16px 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.notif-detail-time {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.notif-detail-time::before {
    content: "🕐";
    font-size: 11px;
    opacity: 0.7;
}

.notifications-footer {
    text-align: center;
    border-top: 1px solid var(--border-color);
}

.notifications-load-more {
    width: 100%;
    padding: 16px;
    background: none;
    border: none;
    color: #4f46e5;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.notifications-load-more:hover {
    background-color: var(--hover-bg);
    color: #4338ca;
    gap: 12px;
}

.notifications-load-more i {
    font-size: 13px;
}

.notifications-loading,
.notifications-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 15px;
}

/* ============================================ */
/* THÈME SOMBRE — NOTIFICATIONS */
/* ============================================ */
.theme-dark .notifications-panel {
    background-color: #1f2937;
    border-color: #374151;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.theme-dark .notifications-header {
    background-color: #111827;
    border-bottom-color: #374151;
}

.theme-dark .notifications-header h3 {
    color: #f3f4f6;
}

.theme-dark .mark-all-read {
    color: #9ca3af;
}

.theme-dark .mark-all-read:hover {
    background-color: #374151;
    color: #818cf8;
}

.theme-dark .notification-item {
    border-bottom-color: #374151;
}

.theme-dark .notification-item:hover {
    background-color: #374151;
}

.theme-dark .notification-item-title {
    color: #f3f4f6;
}

.theme-dark .notification-item-message {
    color: #9ca3af;
}

.theme-dark .notification-item-time {
    color: #6b7280;
}

.theme-dark .notifications-footer {
    border-top-color: #374151;
}

.theme-dark .notifications-load-more {
    color: #818cf8;
}

.theme-dark .notifications-load-more:hover {
    background-color: #374151;
    color: #a5b4fc;
}

/* ============================================ */
/* THÈME SOMBRE — COMPOSANTS */
/* ============================================ */
.theme-dark .badge {
    background-color: #4f46e5;
    color: white;
}

.theme-dark .empty-state {
    background-color: var(--card-bg);
    border-color: var(--border-color);
}

.theme-dark .empty-icon {
    color: var(--text-secondary);
}

/* ============================================ */
/* TOGGLE DE THÈME */
/* ============================================ */
.theme-toggle {
    position: relative;
    width: 60px;
    height: 30px;
    background-color: #e5e7eb;
    border-radius: 30px;
    margin: 0 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
    transition: background-color 0.3s ease;
}

.theme-toggle i {
    font-size: 14px;
    z-index: 2;
    color: #6b7280;
    transition: color 0.3s ease, opacity 0.3s ease;
}

.theme-toggle .fa-sun  { color: #f59e0b; }
.theme-toggle .fa-moon { color: #3b82f6; }

.theme-toggle-slider {
    position: absolute;
    width: 24px;
    height: 24px;
    background-color: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.theme-dark .theme-toggle-slider {
    transform: translateX(30px);
}

.theme-dark .theme-toggle {
    background-color: #374151;
}

/* ============================================ */
/* FOOTER */
/* ============================================ */
.footer {
    background: #111827;
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: white;
}

.footer-section a {
    display: block;
    color: #9CA3AF;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #9CA3AF;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    color: #9CA3AF;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: white;
}

/* ============================================ */
/* FORMULAIRES */
/* ============================================ */
input, select, textarea {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}

input:focus, select:focus {
    border-color: #4f46e5;
    outline: none;
}

/* ============================================ */
/* ANIMATIONS (noms uniques) */
/* ============================================ */
@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px); }
    to   { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse-toggle {
    0%   { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-text {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

@keyframes pulse-notification {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70%  { box-shadow: 0 0 0 12px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes dots {
    0%, 20% { content: ""; }
    40%      { content: "."; }
    60%      { content: ".."; }
    80%, 100%{ content: "..."; }
}

/* ============================================ */
/* RESPONSIVE */
/* ============================================ */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .agents-grid {
        grid-template-columns: 1fr;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .agent-types-grid {
        grid-template-columns: 1fr;
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .nav-menu {
        display: none;
    }

    .hero-buttons,
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }

    .clients-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .webhook-url-container {
        flex-direction: column;
        align-items: stretch;
    }

    .webhook-url {
        margin-bottom: 8px;
    }

    .copy-webhook-btn {
        width: 100%;
        justify-content: center;
    }
}




/* ============================================ */
/* CHATBOT BUBBLE - STYLES CENTRALISÉS */
/* ============================================ */

.chatbot-bubble {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1500;
}

.chatbot-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    transition: all 0.3s;
    color: white;
    font-size: 22px;
}

.chatbot-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.5);
}

.chatbot-btn .icon-chat  { display: block; }
.chatbot-btn .icon-close { display: none; }
.chatbot-btn.open .icon-chat  { display: none; }
.chatbot-btn.open .icon-close { display: block; }

.chatbot-window {
    position: absolute;
    bottom: 68px;
    right: 0;
    width: 360px;
    height: 520px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.18);
    display: none;
    flex-direction: column;
    background: white;
    border: 1px solid #e5e7eb;
}

.chatbot-window.open {
    display: flex;
    animation: slideUp 0.3s ease;
}

.chatbot-header {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.chatbot-header .bot-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.chatbot-header .bot-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.chatbot-header .bot-info span {
    font-size: 11px;
    opacity: 0.8;
}

.chatbot-header .bot-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
    margin-left: auto;
    flex-shrink: 0;
}

.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f9fafb;
}

.chat-msg {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-msg.bot {
    background: white;
    color: #111827;
    border-radius: 4px 14px 14px 14px;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.chat-msg.user {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    border-radius: 14px 14px 4px 14px;
    align-self: flex-end;
}

.chat-typing {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 10px 14px;
    background: white;
    border-radius: 4px 14px 14px 14px;
    align-self: flex-start;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    width: fit-content;
}

.chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    animation: typing 1.2s infinite;
}

.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
    30% { transform: translateY(-5px); opacity: 1; }
}

.chatbot-input {
    padding: 12px 14px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 8px;
    background: white;
    flex-shrink: 0;
}

.chatbot-input input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
    color: #111827;
    background: #f9fafb;
    transition: border-color 0.2s;
}

.chatbot-input input:focus {
    border-color: #4f46e5;
    background: white;
}

.chatbot-input button {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #4f46e5;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.chatbot-input button:hover    { background: #4338ca; }
.chatbot-input button:disabled { background: #a5b4fc; cursor: not-allowed; }

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

@media (max-width: 768px) {
    .chatbot-window { width: calc(100vw - 48px); right: -12px; }
}

/* Thème sombre pour le chatbot */
.theme-dark .chatbot-window {
    background: #1f2937;
    border-color: #374151;
}

.theme-dark .chatbot-messages {
    background: #111827;
}

.theme-dark .chat-msg.bot {
    background: #1f2937;
    color: #f3f4f6;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.theme-dark .chat-msg.user {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
}

.theme-dark .chatbot-input {
    background: #1f2937;
    border-top-color: #374151;
}

.theme-dark .chatbot-input input {
    background: #374151;
    border-color: #4b5563;
    color: #f3f4f6;
}

.theme-dark .chatbot-input input:focus {
    border-color: #818cf8;
    background: #374151;
}

.theme-dark .chat-typing {
    background: #1f2937;
}

.theme-dark .chat-typing span {
    background: #6b7280;
}