 /* CSS intégré pour le dashboard CRM */
 * {
     margin: 0;
     padding: 0;
     box-sizing: border-box;
 }

 body {
     font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
     background: #f8fafc;
     display: flex;
     min-height: 100vh;
 }

 /* Tooltips */
 .tooltip {
     position: relative;
     display: inline-block;
 }

 .tooltip .tooltiptext {
     visibility: hidden;
     min-width: 200px;
     max-width: 280px;
     width: max-content;
     background-color: #1e293b;
     color: #fff;
     text-align: left;
     border-radius: 8px;
     padding: 8px 8px;
     position: absolute;
     z-index: 1000;
     opacity: 0;
     transition: opacity 0.3s, visibility 0.3s;
     font-size: 0.8rem;
     line-height: 1.1;
     box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
     white-space: normal;
 }

 .tooltip .tooltiptext::after {
     content: "";
     position: absolute;
     border-width: 5px;
     border-style: solid;
 }

 .tooltip:hover .tooltiptext {
     visibility: visible;
     opacity: 1;
 }

 /* Tooltip par défaut (en haut) */
 .tooltip .tooltiptext {
     bottom: 110%;
     left: 50%;
     transform: translateX(-50%);
 }

 .tooltip .tooltiptext::after {
     top: 100%;
     left: 50%;
     margin-left: -5px;
     border-color: #1e293b transparent transparent transparent;
 }

 /* Tooltip pour les cartes métriques (en bas) */
 .metric-card .tooltip .tooltiptext {
     bottom: auto;
     top: 110%;
     margin-top: 5px;
 }

 .metric-card .tooltip .tooltiptext::after {
     top: auto;
     bottom: 100%;
     border-color: transparent transparent #1e293b transparent;
 }

 /* Tooltip pour les éléments du menu (à droite) */
 .nav-item.tooltip .tooltiptext {
     left: calc(100% + 10px);
     top: 50%;
     transform: translateY(-50%);
     bottom: auto;
     min-width: 160px;
     max-width: 220px;
 }

 .nav-item.tooltip .tooltiptext::after {
     top: 50%;
     left: 0;
     margin-left: -5px;
     margin-top: -5px;
     border-color: transparent #1e293b transparent transparent;
 }

 /* Tooltip pour la météo (ajustement spécial) */
 .weather-tooltip .tooltiptext {
     bottom: auto;
     top: 120%;
     left: 0;
     transform: none;
     margin-left: 0;
 }

 .weather-tooltip .tooltiptext::after {
     top: auto;
     bottom: 100%;
     left: 20px;
     margin-left: 0;
     border-color: transparent transparent #1e293b transparent;
 }

 /* Tooltip pour les boutons de tableau */
 .btn-sm.tooltip .tooltiptext {
     bottom: 130%;
     left: 50%;
     transform: translateX(-50%);
     min-width: 120px;
     white-space: nowrap;
 }

 /* Tooltip pour les status badges */
 .status-badge.tooltip .tooltiptext {
     bottom: 130%;
     left: 0;
     transform: none;
     min-width: 180px;
 }

 .weather-tooltip {
     cursor: help;
 }

 .chart-tooltip {
     cursor: help;
 }

 /* Tooltip pour les graphiques (positionnement intelligent) */
 .chart-card .tooltip .tooltiptext {
     bottom: auto;
     top: 110%;
     left: 0;
     transform: none;
     margin-left: 0;
 }

 .chart-card .tooltip .tooltiptext::after {
     top: auto;
     bottom: 100%;
     left: 20px;
     border-color: transparent transparent #1e293b transparent;
 }

 /* Amélioration de la lisibilité des infobulles */
 .tooltip .tooltiptext {
     word-wrap: break-word;
     hyphens: auto;
 }

 .tooltip .tooltiptext strong {
     color: #6b7c3e;
     display: block;
     margin-bottom: 4px;
 }

 /* Styles spéciaux pour les infobulles longues */
 .tooltip .tooltiptext br+* {
     margin-top: 2px;
 }

 /* Animation d'apparition plus fluide */
 .tooltip .tooltiptext {
     transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
 }

 /* Éviter les débordements */
 .tooltip .tooltiptext {
     max-height: 200px;
     overflow-y: auto;
 }

 /* Style pour les infobulles dans le header */
 .header .tooltip .tooltiptext {
     bottom: auto;
     top: 120%;
     left: 50%;
     transform: translateX(-50%);
 }

 .header .tooltip .tooltiptext::after {
     top: auto;
     bottom: 100%;
     left: 50%;
     margin-left: -5px;
     border-color: transparent transparent #1e293b transparent;
 }

 /* Modal pour détail client */
 .modal {
     display: none;
     position: fixed;
     z-index: 2000;
     left: 0;
     top: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.5);
     backdrop-filter: blur(4px);
 }

 .modal-content {
     background-color: white;
     margin: 3% auto;
     padding: 20px;
     border-radius: 12px;
     width: 90%;
     max-width: 500px;
     max-height: 90vh;
     overflow-y: auto;
     box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
     position: relative;
     animation: modalSlideIn 0.3s ease-out;
 }

 @keyframes modalSlideIn {
     from {
         opacity: 0;
         transform: translateY(-50px);
     }

     to {
         opacity: 1;
         transform: translateY(0);
     }
 }

 .modal-header {
     display: flex;
     justify-content: space-between;
     align-items: center;
     margin-bottom: 16px;
     padding-bottom: 10px;
     border-bottom: 1px solid #e2e8f0;
 }

 .modal-title {
     font-size: 1.2rem;
     font-weight: 600;
     color: #1e293b;
 }

 .close {
     color: #64748b;
     font-size: 1.3rem;
     font-weight: bold;
     cursor: pointer;
     border: none;
     background: none;
     padding: 4px 8px;
     border-radius: 4px;
     transition: all 0.3s ease;
 }

 .close:hover {
     background: #f1f5f9;
     color: #1e293b;
 }

 .client-detail-grid {
     display: grid;
     grid-template-columns: 2fr 1fr;
     gap: 12px;
     margin-bottom: 16px;
 }

 .client-detail-item {
     padding: 10px;
     background: #f8fafc;
     border-radius: 8px;
 }

 .client-detail-label {
     font-size: 0.75rem;
     color: #64748b;
     margin-bottom: 3px;
     font-weight: 500;
 }

 .client-detail-value {
     font-size: 0.9rem;
     color: #1e293b;
     font-weight: 600;
 }

 .client-avatar-large {
     width: 50px;
     height: 50px;
     border-radius: 10px;
     display: flex;
     align-items: center;
     justify-content: center;
     color: white;
     font-weight: 700;
     font-size: 1.3rem;
     margin-bottom: 12px;
 }

 /* Modal simple pour contact */
 .contact-modal {
     display: none;
     position: fixed;
     z-index: 2100;
     left: 0;
     top: 0;
     width: 100%;
     height: 100%;
     background-color: rgba(0, 0, 0, 0.5);
     backdrop-filter: blur(4px);
 }

 .contact-modal-content {
     background-color: white;
     margin: 15% auto;
     padding: 20px;
     border-radius: 12px;
     width: 90%;
     max-width: 400px;
     box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
     position: relative;
     animation: modalSlideIn 0.3s ease-out;
 }

 .contact-info {
     text-align: center;
     margin: 20px 0;
 }

 .contact-item {
     display: flex;
     align-items: center;
     justify-content: center;
     gap: 12px;
     padding: 12px;
     margin: 8px 0;
     background: #f8fafc;
     border-radius: 8px;
     cursor: pointer;
     transition: all 0.3s ease;
 }

 .contact-item:hover {
     background: #e2e8f0;
 }

 .contact-item i {
     color: #6b7c3e;
     font-size: 1.1rem;
 }

 /* Sidebar */
 .sidebar {
     width: 220px;
     background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
     color: white;
     display: flex;
     flex-direction: column;
     box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
 }

 .sidebar-header {
     padding: 20px 16px;
     border-bottom: 1px solid rgba(255, 255, 255, 0.1);
 }

 .logo {
     font-size: 1.3rem;
     font-weight: 700;
     margin-bottom: 6px;
     display: flex;
     align-items: center;
     gap: 6px;
 }

 .logo i {
     color: #6b7c3e;
 }

 .company-info {
     font-size: 0.8rem;
     opacity: 0.8;
     line-height: 1.3;
 }

 .nav-menu {
     flex: 1;
     padding: 16px 0;
 }

 .nav-item {
     display: flex;
     align-items: center;
     padding: 10px 16px;
     color: rgba(255, 255, 255, 0.8);
     text-decoration: none;
     transition: all 0.3s ease;
     position: relative;
     font-size: 0.85rem;
 }

 .nav-item:hover {
     background: rgba(255, 255, 255, 0.1);
     color: white;
 }

 .nav-item.active {
     background: rgba(34, 197, 94, 0.2);
     color: #6b7c3e;
     border-right: 3px solid #6b7c3e;
 }

 .nav-item i {
     width: 18px;
     margin-right: 10px;
     font-size: 0.9rem;
 }

 .notification-badge {
     background: #ef4444;
     color: white;
     font-size: 0.65rem;
     padding: 2px 5px;
     border-radius: 8px;
     margin-left: auto;
 }

 /* Main Content */
 .main-content {
     flex: 1;
     display: flex;
     flex-direction: column;
 }

 .header {
     background: white;
     padding: 12px 20px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
     display: flex;
     justify-content: space-between;
     align-items: center;
 }

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

 .app-branding {
     display: flex;
     align-items: center;
     gap: 10px;
     text-decoration: none;
     color: inherit;
 }

 .app-logo {
     width: 36px;
     height: 36px;
     background: linear-gradient(135deg, #6b7c3e, #5a9367);
     border-radius: 6px;
     display: flex;
     align-items: center;
     justify-content: center;
     color: white;
     font-size: 1.1rem;
 }

 .app-info h2 {
     font-size: 1.2rem;
     color: #1e293b;
     margin-bottom: 2px;
 }

 .app-tagline {
     font-size: 0.75rem;
     color: #64748b;
 }

 .page-title h1 {
     font-size: 1.6rem;
     color: #1e293b;
     margin-bottom: 2px;
 }

 .date-info {
     font-size: 0.85rem;
     color: #64748b;
 }

 .weather-info {
     font-size: 0.8rem;
     color: #059669;
     margin-top: 2px;
 }

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

 .search-box {
     position: relative;
     display: flex;
     align-items: center;
 }

 .search-box input {
     padding: 10px 16px 10px 40px;
     border: 1px solid #e2e8f0;
     border-radius: 8px;
     width: 300px;
     font-size: 0.9rem;
 }

 .search-box i {
     position: absolute;
     left: 12px;
     color: #64748b;
 }

 .user-profile {
     display: flex;
     align-items: center;
     gap: 12px;
     cursor: pointer;
 }

 .user-avatar {
     width: 36px;
     height: 36px;
     background: linear-gradient(135deg, #3b82f6, #1d4ed8);
     border-radius: 50%;
     display: flex;
     align-items: center;
     justify-content: center;
     color: white;
     font-weight: 600;
     font-size: 0.9rem;
 }

 /* Footer */
 .footer {
     background: #f8fafc;
     border-top: 1px solid #e2e8f0;
     padding: 12px 20px;
     text-align: center;
     margin-top: auto;
     color: #64748b;
 }

 .footer strong {
     color: #1e293b;
 }

 /* Assurer que le footer reste en bas */
 .main-content {
     flex: 1;
     display: flex;
     flex-direction: column;
     min-height: 100vh;
 }

 .content-area {
     flex: 1;
     padding: 16px;
     overflow-y: auto;
 }

 .season-banner {
     background: linear-gradient(135deg, #dcfce7, #bbf7d0);
     border: 1px solid #86efac;
     border-radius: 8px;
     padding: 12px 16px;
     margin-bottom: 12px;
     display: flex;
     align-items: center;
     gap: 12px;
 }

 .season-icon {
     font-size: 1.5rem;
 }

 .seasonal-alert {
     background: #fef3c7;
     border: 1px solid #fbbf24;
     border-radius: 6px;
     padding: 8px 12px;
     margin-bottom: 16px;
     display: flex;
     align-items: center;
     gap: 8px;
     color: #92400e;
     font-size: 0.85rem;
 }

 /* Dashboard Tabs */
 .dashboard-tabs {
     display: flex;
     gap: 4px;
     margin-bottom: 16px;
     border-bottom: 1px solid #e2e8f0;
 }

 .tab-button {
     padding: 8px 16px;
     background: none;
     border: none;
     font-size: 0.85rem;
     color: #64748b;
     cursor: pointer;
     border-bottom: 2px solid transparent;
     transition: all 0.3s ease;
 }

 .tab-button.active {
     color: #6b7c3e;
     border-bottom-color: #6b7c3e;
 }

 .tab-button:hover {
     color: #1e293b;
 }

 /* Tab Content */
 .tab-content {
     display: none;
 }

 .tab-content.active {
     display: block;
 }

 /* Metrics Grid */
 .metrics-grid {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
     gap: 12px;
     margin-bottom: 16px;
 }

 .metric-card {
     background: white;
     border-radius: 8px;
     padding: 14px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
     border-left: 4px solid var(--accent-color);
 }

 .metric-header {
     display: flex;
     justify-content: space-between;
     align-items: flex-start;
 }

 .metric-title {
     font-size: 0.8rem;
     color: #64748b;
     margin-bottom: 2px;
 }

 .metric-value {
     font-size: 1.6rem;
     font-weight: 700;
     color: #1e293b;
     margin-bottom: 2px;
 }

 .metric-change {
     font-size: 0.75rem;
     display: flex;
     align-items: center;
     gap: 4px;
 }

 .metric-change.positive {
     color: #059669;
 }

 .metric-change.negative {
     color: #dc2626;
 }

 .metric-change.seasonal {
     color: #d97706;
 }

 .metric-icon {
     width: 36px;
     height: 36px;
     border-radius: 8px;
     background: var(--icon-bg);
     display: flex;
     align-items: center;
     justify-content: center;
     color: var(--accent-color);
     font-size: 1rem;
 }

 /* Charts Grid */
 .charts-grid {
     display: grid;
     grid-template-columns: 2fr 1fr;
     gap: 16px;
     margin-bottom: 16px;
 }

 .chart-card {
     background: white;
     border-radius: 8px;
     padding: 16px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
 }

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

 .chart-title {
     font-size: 1rem;
     font-weight: 600;
     color: #1e293b;
 }

 .chart-filters {
     display: flex;
     gap: 6px;
 }

 .filter-btn {
     padding: 4px 8px;
     border: 1px solid #e2e8f0;
     background: white;
     border-radius: 4px;
     font-size: 0.75rem;
     cursor: pointer;
     transition: all 0.3s ease;
 }

 .filter-btn.active {
     background: #6b7c3e;
     color: white;
     border-color: #6b7c3e;
 }

 .chart-container {
     height: 200px;
     position: relative;
 }

 /* Hauteur spéciale pour le graphique saisonnier */
 #seasonal .chart-container {
     height: 280px;
 }

 /* Data Table */
 .data-table {
     background: white;
     border-radius: 12px;
     overflow: hidden;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
 }

 .table-header {
     padding: 20px 24px;
     border-bottom: 1px solid #e2e8f0;
     display: flex;
     justify-content: space-between;
     align-items: center;
 }

 .table-title {
     font-size: 1.1rem;
     font-weight: 600;
     color: #1e293b;
 }

 .table-actions {
     display: flex;
     gap: 12px;
 }

 .btn {
     padding: 8px 16px;
     border-radius: 6px;
     font-size: 0.85rem;
     font-weight: 500;
     cursor: pointer;
     border: none;
     transition: all 0.3s ease;
     display: flex;
     align-items: center;
     gap: 6px;
 }

 .btn-primary {
     background: #6b7c3e;
     color: white;
 }

 .btn-primary:hover {
     background: #5a9367;
 }

 .btn-secondary {
     background: #f1f5f9;
     color: #475569;
     border: 1px solid #e2e8f0;
 }

 .btn-secondary:hover {
     background: #e2e8f0;
 }

 .btn-sm {
     padding: 4px 8px;
     font-size: 0.75rem;
 }

 table {
     width: 100%;
     border-collapse: collapse;
 }

 th {
     padding: 8px 16px;
     text-align: left;
     font-weight: 600;
     color: #374151;
     background: #f8fafc;
     border-bottom: 1px solid #e2e8f0;
     line-height: 1.1;
 }

 td {
     padding: 8px 16px;
     border-bottom: 1px solid #f1f5f9;
     color: #374151;
     line-height: 1.1;
 }

 .action-buttons {
     display: flex;
     align-items: center;
     gap: 8px;
 }

 tr:hover {
     background: #f8fafc;
 }

 .status-badge {
     padding: 4px 8px;
     border-radius: 12px;
     font-size: 0.75rem;
     font-weight: 500;
     text-transform: capitalize;
 }

 .status-premium {
     background: #fef3c7;
     color: #92400e;
 }

 .status-active {
     background: #dcfce7;
     color: #166534;
 }

 .status-standard {
     background: #e0f2fe;
     color: #0c4a6e;
 }

 /* Actions Panel */
 .actions-panel {
     background: white;
     border-radius: 12px;
     padding: 24px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
     margin-bottom: 24px;
 }

 .action-item {
     display: flex;
     justify-content: space-between;
     align-items: center;
     padding: 16px;
     border: 1px solid #e2e8f0;
     border-radius: 8px;
     margin-bottom: 12px;
 }

 .action-title {
     font-weight: 600;
     color: #1e293b;
     margin-bottom: 4px;
 }

 .action-description {
     font-size: 0.9rem;
     color: #64748b;
 }

 .action-meta {
     display: flex;
     align-items: center;
     gap: 12px;
 }

 .priority-urgente {
     background: #fee2e2;
     color: #dc2626;
 }

 .priority-haute {
     background: #fef3c7;
     color: #d97706;
 }

 .priority-normale {
     background: #e0f2fe;
     color: #0369a1;
 }

 /* Analytics Insights */
 .analytics-insights {
     display: grid;
     grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
     gap: 20px;
 }

 .insight-card {
     background: white;
     border-radius: 12px;
     padding: 20px;
     box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
 }

 .insight-title {
     font-size: 0.9rem;
     color: #64748b;
     margin-bottom: 8px;
 }

 .insight-value {
     font-size: 1.5rem;
     font-weight: 700;
     color: #1e293b;
     margin-bottom: 8px;
 }

 .insight-description {
     font-size: 0.85rem;
     color: #64748b;
     line-height: 1.4;
 }

 .loading-spinner {
     width: 16px;
     height: 16px;
     border: 2px solid #f3f4f6;
     border-top: 2px solid #6b7c3e;
     border-radius: 50%;
     animation: spin 1s linear infinite;
     margin-right: 8px;
 }

 @keyframes spin {
     0% {
         transform: rotate(0deg);
     }

     100% {
         transform: rotate(360deg);
     }
 }

 /* Responsive */
 @media (max-width: 1024px) {
     .charts-grid {
         grid-template-columns: 1fr;
         gap: 12px;
     }

     .chart-container {
         height: 180px;
     }

     #seasonal .chart-container {
         height: 250px;
     }

     /* Ajustement des tooltips sur tablettes */
     .nav-item.tooltip .tooltiptext {
         max-width: 200px;
     }
 }

 @media (max-width: 768px) {
     .sidebar {
         width: 180px;
     }

     .nav-item {
         padding: 8px 12px;
         font-size: 0.8rem;
     }

     .nav-item i {
         width: 16px;
         margin-right: 8px;
         font-size: 0.8rem;
     }

     .metrics-grid {
         grid-template-columns: 1fr;
         gap: 8px;
     }

     .search-box input {
         width: 180px;
     }

     .content-area {
         padding: 12px;
     }

     .metric-card {
         padding: 10px;
     }

     .chart-card {
         padding: 12px;
     }

     .chart-container {
         height: 160px;
     }

     #seasonal .chart-container {
         height: 220px;
     }

     /* Tooltips adaptés mobile */
     .tooltip .tooltiptext {
         max-width: 250px;
         font-size: 0.75rem;
         position: fixed;
         z-index: 9999;
     }

     .nav-item.tooltip:hover .tooltiptext {
         left: 190px !important;
         top: 50% !important;
         transform: translateY(-50%) !important;
         max-width: calc(100vw - 200px);
     }

     .header .tooltip .tooltiptext {
         position: fixed;
         top: 60px !important;
         left: 50% !important;
         transform: translateX(-50%) !important;
         max-width: calc(100vw - 40px);
     }

     /* Désactiver les tooltips sur très petits écrans */
     @media (max-width: 480px) {
         .tooltip:hover .tooltiptext {
             display: none !important;
         }

         .sidebar {
             width: 160px;
         }

         .search-box input {
             width: 150px;
         }

         .footer {
             padding: 8px 12px;
         }

         .footer div:first-child {
             font-size: 0.75rem !important;
             margin-bottom: 2px !important;
         }

         .footer div:last-child {
             font-size: 0.65rem !important;
         }
     }
 }

 @media (min-height: 900px) {
     .chart-container {
         height: 220px;
     }

     #seasonal .chart-container {
         height: 320px;
     }
 }

 @media (max-height: 768px) {
     .chart-container {
         height: 180px;
     }

     #seasonal .chart-container {
         height: 240px;
     }

     .content-area {
         padding: 12px;
     }

     .sidebar-header {
         padding: 16px 12px;
     }

     .nav-menu {
         padding: 12px 0;
     }

     .footer {
         padding: 10px 16px;
         font-size: 0.8rem;
     }

     .footer div:first-child {
         font-size: 0.8rem !important;
     }

     .footer div:last-child {
         font-size: 0.7rem !important;
     }
 }

 .action-buttons {
     display: flex;
     gap: 4px;
     align-items: center;
 }

 .btn-action {
     padding: 6px 8px;
     border: none;
     border-radius: 4px;
     cursor: pointer;
     font-size: 14px;
 }

 .btn-view {
     background: #e2e8f0;
     color: #1e293b;
 }

 .btn-contact {
     background: #5a9367;
     color: white;
 }
 