:root {
  --bg: #0f172a; --panel: #1e293b; --panel2: #334155;
  --text: #f1f5f9; --muted: #94a3b8; --border: #334155;
  --accent: #64748b; 
  /* --- BLEU OPÉRATIONNEL (#0096FF) --- */
  --accent2: #0096FF; 
  --good: #10b981; --bad: #ef4444;
  --star-filled: #0096FF; 
  --star-empty: #475569;
}

/* --- RESET RESPONSIVE (ANTI-DÉBORDEMENT) --- */
*, *::before, *::after { box-sizing: border-box; }
img, canvas, iframe { max-width: 100%; }


body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); margin: 0; padding: 15px 20px; -webkit-font-smoothing: antialiased; overflow-x: hidden; }

.container { max-width: 1500px; margin: auto; }

/* --- EN-TÊTE FIXE --- */
.header-container {
    position: sticky; top: 10px; z-index: 100; 
    background-image: url('world.png'); background-size: cover; background-position: top center; 
    padding: 12px 20px 0 20px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 8px; /* <-- Modifié ici */
    box-shadow: 0 15px 20px -5px rgba(0,0,0,0.6);
}

.header-branding-row { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: 10px; gap: 15px; }
.header-left { display: flex; justify-content: flex-start; }
.header-center { display: flex; justify-content: center; text-align: center; }
.header-right { display: flex; justify-content: flex-end; }

.desktop-title { display: block; margin: 0; font-size: 1.25em; font-weight: 800; color: #fff; letter-spacing: -0.01em; text-shadow: 0 3px 8px rgba(0,0,0,0.9); }
.mobile-title { display: none; margin: 0; font-size: 1.25em; font-weight: 800; color: #fff; letter-spacing: -0.01em; text-shadow: 0 3px 8px rgba(0,0,0,0.9); }

.header-flag-logo { height: 100px; width: auto; border-radius: 4px; filter: drop-shadow(0 4px 6px rgba(0,0,0,0.5)); margin-top: -5px; margin-bottom: -40px; position: relative; z-index: 10; }

.btn-logout { height: 32px; padding: 0 12px; border-radius: 6px; cursor: pointer; font-weight: 700; border: none; background: var(--bad); color: #fff; transition: 0.2s; font-size: 0.85em; box-shadow: 0 2px 5px rgba(0,0,0,0.5); }
.btn-logout:hover { filter: brightness(1.1); transform: scale(1.02); }

/* --- NAVIGATION PAR ONGLETS --- */
.tabs-container { display: flex; gap: 4px; margin-top: 5px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.tabs-container::-webkit-scrollbar { display: none; }

.tab-btn { 
    height: 34px; 
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #334155; 
    color: #e2e8f0; 
    border: 1px solid rgba(255,255,255,0.05); 
    border-bottom: 3px solid #475569; 
    padding: 0 11px; 
    cursor: pointer; 
    font-weight: 600; 
    font-size: 0.85em; 
    transition: 0.2s; 
    border-radius: 8px 8px 0 0; 
    box-shadow: 0 -2px 5px rgba(0,0,0,0.2); 
    white-space: nowrap;
    line-height: 1;
    /* CORRECTION DU BUG DE CLIC : */
    position: relative; 
    z-index: 11; 
}
.tab-btn:hover { background: #475569; color: #fff; }
.tab-btn.active { background: var(--panel); color: #fff; border-bottom: 3px solid var(--accent2); border-top: 1px solid var(--border); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }

.tab-pane { animation: fadeIn 0.3s ease; position: relative; z-index: 1; }
.tab-pane:not(#tab-veille) { padding-top: 5px; }

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

/* --- ONGLET NEWSLETTER --- */
.tab-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.newsletter-dropdown { background: var(--panel); color: #fff; border: 1px solid var(--border); padding: 0 8px; height: 28px; border-radius: 6px; outline: none; cursor: pointer; font-size: 0.75em; font-weight: 600; transition: 0.2s; box-sizing: border-box; }
.newsletter-dropdown:hover { background: #242f44; }
.newsletter-dropdown:focus { border-color: var(--accent2); }
.newsletter-dropdown option { background: var(--panel); color: #fff; }
.newsletter-meta-text { color: #e2e8f0; font-weight: normal; font-size: 0.85em; text-transform: lowercase; }

/* --- ONGLET ARCHIVE (RECHERCHE) --- */
.search-tools { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 15px; }
#search-bar { flex: 1; height: 28px; border-radius: 6px; padding: 0 10px; background: var(--panel); border: 1px solid var(--border); color: #fff; font-size: 0.85em; outline: none; box-sizing: border-box; transition: 0.2s; }
#search-bar:focus { border-color: var(--accent2); }
.filters-container { flex-shrink: 0; }

/* 🟢 AJOUT DES COLONNES (POUR ORDINATEUR) 🟢 */
.search-split-view { display: flex; gap: 15px; align-items: flex-start; flex-wrap: nowrap; width: 100%; }
.search-list-col { flex: 3; max-height: calc(100vh - 180px); overflow-y: auto; padding-right: 5px; min-width: 0; }
.search-preview-col { flex: 2; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 15px; position: sticky; top: 130px; max-height: calc(100vh - 150px); overflow-y: auto; display: flex; flex-direction: column; box-shadow: 0 10px 15px -3px rgba(0,0,0,0.3); min-width: 0; }

/* 🟢 STYLE DU TEXTE DE PRÉVISUALISATION 🟢 */
.preview-meta { font-size: 0.65em; color: var(--muted); text-transform: uppercase; font-weight: 700; margin-bottom: 5px; }
.preview-title { font-size: 0.9em; color: #fff; margin: 0 0 10px 0; line-height: 1.3; font-weight: 700; }
.preview-content { font-size: 0.85em; color: #cbd5e1; line-height: 1.5; white-space: pre-wrap; margin-bottom: 15px; }

/* Fond transparent bleu pour le So What */
.preview-sowhat-box { background: rgba(0, 150, 255, 0.08); border-left: 3px solid var(--accent2); padding: 10px; border-radius: 4px; }
.preview-sowhat-box strong { font-size: 0.75em; color: var(--accent2); display: block; margin-bottom: 4px; text-transform: uppercase; }
#preview-sowhat { font-size: 0.85em; color: #ffffff; font-style: italic; line-height: 1.4; white-space: pre-wrap; }

/* --- ONGLET STATISTIQUES --- */
.dashboard-container { display: flex; gap: 15px; margin-bottom: 15px; align-items: stretch; }
.dashboard-totals { flex: 1; display: flex; flex-direction: column; gap: 15px; } 
.stat-card { flex: 1; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 15px; text-align: center; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2); display: flex; flex-direction: column; justify-content: center; }
.stat-card h3 { color: var(--muted); font-size: 0.7em; margin: 0 0 5px 0; text-transform: uppercase; font-weight: 700; letter-spacing: 0.05em; }
.stat-card p { color: var(--accent2); font-size: 1.6em; font-weight: 800; margin: 0; line-height: 1; }
.dashboard-chart { flex: 4; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 15px 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2); display: flex; flex-direction: column; overflow: hidden; }
.chart-wrapper { flex: 1; position: relative; max-height: 450px; height: 450px; width: 100%; min-height: 250px; }

.analyse-container { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 20px; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2); }
.stats-title { margin-top: 0; margin-bottom: 10px; color: #fff; font-size: 0.9em; }
.stats-title-warning { margin-top: 0; color: var(--accent2); font-size: 0.9em; margin-bottom: 5px; }
.stats-subtitle { color: var(--muted); font-size: 0.85em; margin-top: 0; margin-bottom: 15px; }

/* --- ONGLET UTILISATEURS --- */
.users-table { width: 100%; border-collapse: collapse; text-align: left; }
.users-table th { color: var(--muted); font-size: 0.75em; text-transform: uppercase; border-bottom: 2px solid var(--border); padding: 6px 10px !important; }
.users-table td { padding: 6px 10px !important; border-bottom: 1px solid var(--border); color: #f1f5f9; font-size: 0.85em; }

/* --- MISE À JOUR DU FOND TRANSPARENT (RGBA) POUR LE BLEU --- */
.preview-sowhat-box { background: rgba(0, 150, 255, 0.08); border-left: 3px solid var(--accent2); padding: 10px; border-radius: 4px; }
.preview-sowhat-box strong { font-size: 0.75em; color: var(--accent2); display: block; margin-bottom: 4px; text-transform: uppercase; }
#preview-sowhat { font-size: 0.85em; color: #ffffff; font-style: italic; line-height: 1.4; white-space: pre-wrap; }

/* --- ONGLET ÉDITEUR --- */
.editor-panel { background: var(--panel); padding: 20px 25px; border-radius: 12px; border: 1px solid var(--border); }
.editor-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 12px; }
.editor-header h2 { margin: 0; color: #fff; font-size: 1.1em; }

/* Sécurité d'enregistrement */
#btn-save-article:disabled { cursor: not-allowed !important; filter: saturate(0.5); }

/* --- CARTES ARTICLES (Global) --- */
.articles-grid { display: flex; flex-direction: column; gap: 6px; }
.card { background: var(--panel); border-radius: 8px; border: 1px solid var(--border); cursor: pointer; position: relative; margin-bottom: 2px; }
.card:hover { background: #242f44; border-color: var(--accent); }

/* NEWSLETTER */
.card-newsletter { padding: 10px 15px; }
.card-title-newsletter { font-weight: 600; font-size: 0.9em; color: #fff; margin: 0; line-height: 1.3; padding-right: 25px; }
.card-body-visible { margin-top: 6px; }
.card-sowhat { color: #ffffff; font-size: 0.85em; font-style: italic; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 6px; margin-top: 6px; line-height: 1.4; }
.card-sowhat strong { color: var(--accent2); }

.edit-icon { position: absolute; right: 10px; top: 10px; opacity: 0.25; font-size: 1.1em; transition: 0.2s; z-index: 2; cursor: pointer; }
.edit-icon:hover { opacity: 1; color: var(--accent2); transform: scale(1.1); }

/* RECHERCHE */
.card-search { padding: 8px 10px; transition: background 0.2s ease; }
.search-item-row { display: flex; align-items: center; gap: 6px; width: 100%; box-sizing: border-box; }
.card-issue { font-weight: 500; color: #94a3b8; font-size: 0.85em; white-space: nowrap; flex-shrink: 0; min-width: 20px; text-align: left; margin-left: -2px; }
.card-title-search { font-weight: normal; font-size: 0.85em; color: #f1f5f9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-grow: 1; margin: 0; }

/* --- MODALES --- */
.modal { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.92); display: flex; align-items: center; justify-content: center; z-index: 9999; backdrop-filter: blur(6px); }
.modal-content { background: #1e293b; width: 92%; max-width: 820px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5); }
.modal-header { padding: 12px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: rgba(15, 23, 42, 0.5); }
.modal-body { padding: 20px 30px; overflow-y: auto; max-height: 75vh; }
.close-btn { font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; transition: 0.2s; }
.close-btn:hover { color: #fff; }

.view-title { color: #fff; margin-top: 0; margin-bottom: 12px; font-size: 1em; font-weight: 700; line-height: 1.3; } 
.view-text { line-height: 1.5; white-space: pre-wrap; color: #d1d5db; font-size: 0.85em; margin-bottom: 20px; } 

/* --- MISE À JOUR DU FOND TRANSPARENT (RGBA) POUR LE BLEU --- */
.sowhat-box { background: rgba(0, 150, 255, 0.08); border-left: 4px solid var(--accent2); padding: 15px 20px; border-radius: 6px; }
.sowhat-box strong { color: var(--accent2); display: block; margin-bottom: 6px; font-size: 0.75em; text-transform: uppercase; letter-spacing: 0.05em; }
.sowhat-content { font-style: italic; font-size: 0.85em; color: #ffffff; line-height: 1.5; } 

.source-badge { display: inline-block; background: rgba(96, 165, 250, 0.1); color: #60a5fa; padding: 6px 14px; border-radius: 20px; font-size: 0.8em; text-decoration: none; border: 1px solid rgba(96, 165, 250, 0.3); transition: 0.2s; font-weight: 600; }

/* Login */
#login-screen { position: fixed; inset: 0; background: #020617; display: flex; align-items: center; justify-content: center; z-index: 10000; }
.login-box { background: #1e293b; padding: 40px; border-radius: 12px; border: 1px solid var(--border); width: 100%; max-width: 400px; box-sizing: border-box; text-align: center; }
.login-box input { width: 100%; padding: 10px 15px; margin-bottom: 12px; border-radius: 6px; border: 1px solid var(--border); background: #0f172a; color: #fff; box-sizing: border-box; font-size: 0.85em; }

/* =======================================================
   🕒 HORLOGES OPÉRATIONNELLES (GRILLE FLUIDE)
   ======================================================= */
.clocks-grid {
    display: grid;
    /* minmax(0, 1fr) empêche le contenu de forcer le retour à la ligne */
    grid-template-columns: repeat(4, minmax(0, 1fr)); 
    gap: 12px; /* Réduit pour s'approcher de l'espacement Veille */
    margin-top: 0; /* Suppression de l'espace mort au-dessus */
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 1000px) { .clocks-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 550px) { .clocks-grid { grid-template-columns: 1fr; } }

/* =======================================================
   📡 STYLES SPÉCIFIQUES AU RADAR IA (VEILLE)
   ======================================================= */

.filters-header { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 15px; border-bottom: 1px solid var(--border); padding-bottom: 12px; 
    flex-wrap: wrap; gap: 10px; 
    position: sticky; 
    top: 0; 
    z-index: 100; 
    background: var(--bg);
    padding-top: 5px; /* <-- Modifié ici */
}
.filters-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex-grow: 1; }
.actions-group { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.filter-select { background: var(--panel); color: #fff; border: 1px solid var(--border); padding: 0 8px; height: 28px; border-radius: 6px; outline: none; cursor: pointer; font-size: 0.75em; font-weight: 600; transition: 0.2s; box-sizing: border-box; }
.filter-select:hover { background: #242f44; }

.star-filter-container { display: flex; align-items: center; gap: 6px; background: var(--panel); padding: 0 10px; border-radius: 6px; border: 1px solid var(--border); height: 28px; box-sizing: border-box; }
.filter-label { font-size: 0.75em; font-weight: 600; color: var(--muted); display: flex; align-items: center; }

.toggle-container { display: flex; align-items: center; gap: 6px; background: var(--panel); border: 1px solid var(--border); padding: 0 8px; height: 28px; border-radius: 6px; box-sizing: border-box; }
.toggle-label { font-size: 0.7em; font-weight: 700; color: var(--muted); transition: 0.3s; display: flex; align-items: center; line-height: 1; }
.toggle-label.active { color: var(--accent2); }
.toggle-switch { position: relative; display: flex; align-items: center; width: 28px; height: 16px; margin: 0 2px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: var(--panel2); transition: .3s; border-radius: 16px; }
.toggle-slider:before { position: absolute; content: ""; height: 12px; width: 12px; left: 2px; bottom: 2px; background-color: white; transition: .3s; border-radius: 50%; }
.toggle-switch input:checked + .toggle-slider { background-color: var(--accent2); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(12px); }

.card-compact { background: var(--panel); border-radius: 8px; border: 1px solid var(--border); padding: 10px 14px; position: relative; transition: 0.2s; display: flex; flex-direction: column; gap: 4px; }
.card-compact:hover { border-color: var(--accent); background: #242f44; }

.card-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(255,255,255,0.05); padding-bottom: 6px; margin-bottom: 4px; gap: 10px; }
.card-date { font-size: 0.65em; color: var(--muted); min-width: 105px; font-weight: 500;}
.card-source-link { color: #60a5fa; text-decoration: none; font-weight: 700; padding: 2px 8px; background: rgba(96, 165, 250, 0.1); border-radius: 4px; transition: 0.2s; font-size: 0.55em; text-transform: uppercase; letter-spacing: 0.05em; display: inline-flex; align-items: center; gap: 4px; border: 1px solid rgba(96, 165, 250, 0.2); }

.btn-small { padding: 4px 8px; font-size: 0.65em; border-radius: 4px; cursor: pointer; border: none; font-weight: bold; transition: 0.2s; background: transparent; color: var(--muted); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; }
.btn-small:hover { background: rgba(239, 68, 68, 0.1); color: var(--bad); border-color: var(--bad); }

.star-rating { display: inline-flex; align-items: center; gap: 2px; font-size: 0.9em; line-height: 1; margin-top: 1px; }
.star-rating-filter { display: flex; align-items: center; gap: 2px; font-size: 0.9em; cursor: pointer; line-height: 1; }
.star, .filter-star { color: var(--star-empty); } 
.star.full, .filter-star.full { color: var(--star-filled); } 
.star.half, .filter-star.half { position: relative; display: inline-block; color: var(--star-empty); }
.star.half::after, .filter-star.half::after { content: '★'; position: absolute; left: 0; top: 0; color: var(--star-filled); overflow: hidden; width: 50%; }

/* Typographie Spécifique Radar (Inversée : FR principal, US secondaire) */
.titre-fr { font-size: 1em; font-weight: 700; color: #f1f5f9; margin: 0; line-height: 1.4; font-style: normal; }

.logs-table { width: 100%; border-collapse: collapse; text-align: left; }
.logs-table th { color: var(--muted); font-size: 0.7em; text-transform: uppercase; border-bottom: 2px solid var(--border); padding: 4px 5px; position: sticky; top: -21px; background: var(--panel); z-index: 10; }
.logs-table td { padding: 3px 5px; border-bottom: 1px solid var(--border); color: #f1f5f9; font-size: 0.75em; }

/* =======================================================
   📱 RESPONSIVE DESIGN (SÉCURISÉ)
   ======================================================= */
@media (max-width: 768px) {
    body { padding: 10px; } /* Marges réduites pour gagner de la place */
    
    .desktop-title { display: none; }
    .mobile-title { display: block; text-align: center; }
    .header-flag-logo { height: 50px; margin-top: -2px; margin-bottom: -15px; }
    .header-branding-row { grid-template-columns: auto 1fr auto; gap: 10px; }
    
    .tab-text { display: none; }
    .tab-btn { padding: 8px 12px; font-size: 0.85em; }
    
    .search-tools { flex-direction: column; align-items: stretch; gap: 10px; }
    .search-split-view { flex-direction: column; }
    .search-list-col { max-height: none !important; overflow-y: visible !important; }
    .search-preview-col { display: none !important; }
    .card-title-search { font-size: 0.85em; font-weight: 600; white-space: normal; }
    
    .dashboard-container { flex-direction: column; }
    .dashboard-totals { flex-direction: row; width: 100%; gap: 10px; }
    .stat-card { padding: 10px; }
    .stat-card p { font-size: 1.3em; } 
    .chart-wrapper { max-height: 250px; height: 250px; }
    
    .modal-content { width: 95%; max-height: 90vh; }
    .modal-body { padding: 15px; }
    .editor-panel { padding: 15px; }

    /* --- SÉCURITÉS ANTI-DÉBORDEMENT MOBILES --- */
    
    /* 1. Annule les largeurs minimales forcées (ex: graphiques à 300px) */
    .dashboard-chart, .stat-card, input, select, textarea { 
        min-width: 0 !important; 
        max-width: 100%; 
    }
    
    /* 2. Permet aux tableaux (utilisateurs, logs) de scroller horizontalement en interne */
    .logs-table, .users-table { 
        display: block; 
        width: 100%; 
        overflow-x: auto; 
        white-space: nowrap; 
        -webkit-overflow-scrolling: touch;
    }
    
    /* 3. Force la césure des mots très longs (ex: liens URL dans les cartes) */
    * { overflow-wrap: break-word; word-wrap: break-word; }
}


/* =======================================================
   🖋️ TYPOGRAPHIE & MISE EN PAGE ÉDITORIALE (1000px & NEWSLETTER)
   ======================================================= */

/* 1. Limiter la largeur du flux sur les grands écrans (Passé à 1000px) */
#veille-container, 
#newsletter-container, 
#search-container {
    max-width: 1000px; 
    margin-left: auto; 
    margin-right: auto;
}

/* 2. Typographie des Titres : Plus d'impact visuel (Veille + Newsletter) */
.titre-fr, 
.view-title, 
.preview-title,
.card-title-newsletter {
    font-size: 1.15em !important; 
    font-weight: 800 !important;
    color: #ffffff !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em;
    margin-bottom: 4px !important;
}

/* 3. Le corps du texte : Aéré et propre (Veille + Newsletter) */
.view-text, 
.preview-content, 
.sowhat-content,
.card-body-visible p {
    font-size: 0.9em !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    max-width: none !important; 
}

/* 4. Ligne verticale style "Presse" pour les résumés (Veille + Newsletter) */
.card-body-visible p {
    background: transparent !important; 
    border-left: 2px solid #475569 !important; 
    padding: 2px 0 2px 12px !important;
    margin-top: 8px !important;
}

/* 5. Harmonisation de l'encart "SO WHAT?" de la Newsletter (Style Veille) */
.card-sowhat {
    font-size: 0.9em !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    background: rgba(0, 150, 255, 0.08) !important; 
    border-left: 3px solid var(--accent2) !important; 
    border-top: none !important;
    padding: 10px 12px !important; 
    border-radius: 4px !important;
    margin-top: 12px !important;
}

.card-sowhat strong {
    color: var(--accent2) !important;
    font-size: 0.95em !important;
}

/* 6. Adaptation de la largeur des fenêtres de lecture pop-up */
.modal-content {
    max-width: 850px !important; 
}

/* =======================================================
   🖋️ TYPOGRAPHIE ÉDITORIALE & CORRECTIONS (À AJOUTER À LA FIN)
   ======================================================= */

/* 1. Limiter la largeur (1000px) et centrer */
#veille-container, 
#newsletter-container, 
#search-container {
    max-width: 1000px; 
    margin-left: auto; 
    margin-right: auto;
}

/* 2. Typographie des Titres */
.titre-fr, 
.view-title, 
.preview-title,
.card-title-newsletter {
    font-size: 1.15em !important; 
    font-weight: 800 !important;
    color: #ffffff !important;
    line-height: 1.3 !important;
    letter-spacing: -0.01em;
    margin-bottom: 4px !important;
}

/* 3. Textes aérés et bordure "Presse" */
.view-text, 
.preview-content, 
.sowhat-content,
.card-body-visible p {
    font-size: 0.9em !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    max-width: none !important; 
    background: transparent !important; 
    border-left: 2px solid #475569 !important; 
    padding: 2px 0 2px 12px !important;
    margin-top: 8px !important;
}

/* 4. Encart SO WHAT? (Unifié) */
.card-sowhat, .preview-sowhat-box, .sowhat-box {
    font-size: 0.9em !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    background: rgba(0, 150, 255, 0.08) !important; 
    border-left: 3px solid var(--accent2) !important; 
    padding: 10px 12px !important; 
    border-radius: 4px !important;
    margin-top: 12px !important;
}

.card-sowhat strong, .preview-sowhat-box strong, .sowhat-box strong {
    color: var(--accent2) !important;
}

/* 5. Réparation de l'Archive (2 colonnes verrouillées sur PC) */
.search-split-view { display: flex; gap: 15px; align-items: flex-start; flex-wrap: nowrap; width: 100%; }
.search-list-col { flex: 3; min-width: 0; }
.search-preview-col { flex: 2; position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; display: flex; flex-direction: column; min-width: 0; }

/* 6. CORRECTIONS MOBILES (Barre Safari + Tailles ajustées) */
@media (max-width: 768px) {
    /* Libération du scroll pour cacher l'URL sur smartphone */
    body, html { height: auto !important; overflow-y: visible !important; }
    .tab-pane { height: auto !important; overflow-y: visible !important; padding-bottom: 80px !important; }
    
    /* Menu fixé en haut */
    
/* En-tête "Sticky" avec image préservée et effet flouté */
    .header-container {
        position: sticky;
        top: 0;
        z-index: 100;
        /* On ne modifie QUE la couleur (semi-transparente pour lire le texte), sans écraser l'image */
        background-color: rgba(15, 23, 42, 0.4) !important; 
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--border);
        padding-top: 10px;
    }
    
    /* Colonnes archive empilées sur mobile */
    .search-split-view { flex-direction: column; }
    .search-preview-col { position: relative; top: 0; max-height: none; margin-bottom: 15px; }
    
    /* Polices réduites pour petits écrans */
    .titre-fr, .view-title, .preview-title, .card-title-newsletter { font-size: 1.05em !important; line-height: 1.25 !important; }
    .view-text, .preview-content, .sowhat-content, .card-body-visible p, .card-sowhat { font-size: 0.85em !important; }
}

/* =======================================================
   🛠️ CORRECTIONS BUGS MOBILES (RADAR & ONGLETS)
   ======================================================= */

/* 1. Onglets : Faire glisser jusqu'au bord exact de l'écran */
.tabs-container {
    flex-wrap: nowrap; /* Empêche formellement de passer à la ligne */
}

@media (max-width: 768px) {
.tabs-container {
    margin-left: -20px !important;
    margin-right: -20px !important;
    padding-left: 20px !important;
    padding-right: 20px !important; 
    
    border-radius: 0 0 12px 12px !important; /* (Ou 12px 12px 0 0 selon tes angles) */
    
    /* 🌟 LA FAMEUSE BORDURE FINE : */
    border-bottom: 1px solid var(--border) !important; 
    
    flex-wrap: nowrap !important; 
}

    /* 2. Veille : Hauteur ajustée au millimètre et suppression des marges fantômes */
    #tab-veille {
        height: calc(100dvh - 105px) !important; /* 105px compense exactement la hauteur de ton en-tête mobile + les onglets */
        padding-bottom: 0 !important;
        margin-bottom: 0 !important;
        overflow: hidden !important;
    }
    
    #tab-veille iframe {
        display: block !important; /* Obligatoire pour tuer l'espace vide naturel sous l'iframe */
        height: 100% !important;
    }
}
/* =======================================================
   🛠️ CORRECTIONS STATISTIQUES (ASCENSEURS)
   ======================================================= */
#stat-sources-list-news, 
#stat-words-list-news, 
#stat-sources-list-veille, 
#stat-words-list-veille {
    /* Repousse les chiffres vers la gauche pour ne pas toucher l'ascenseur */
    padding-right: 15px !important; 
}

/* 🎨 Bonus : Rendre ces ascenseurs plus fins et élégants (Style Mac) */
#stat-sources-list-news::-webkit-scrollbar, 
#stat-words-list-news::-webkit-scrollbar, 
#stat-sources-list-veille::-webkit-scrollbar, 
#stat-words-list-veille::-webkit-scrollbar {
    width: 6px;
}
#stat-sources-list-news::-webkit-scrollbar-thumb, 
#stat-words-list-news::-webkit-scrollbar-thumb, 
#stat-sources-list-veille::-webkit-scrollbar-thumb, 
#stat-words-list-veille::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

/* =======================================================
   🛠️ CORRECTION ONGLETS (TEXTE COUPÉ ET ARRONDIS)
   ======================================================= */

/* 1. Interdire aux boutons de rétrécir (Corrige le texte coupé sur l'horloge) */
.tab-btn {
    flex-shrink: 0 !important;
}

/* 2. Pousser jusqu'au bord tout en épousant l'arrondi de ton design */
.tabs-container {
    margin-left: -20px !important;
    margin-right: -20px !important;
    padding-left: 20px !important;
    padding-right: 20px !important; /* Laisse l'espace pour que le texte ne colle pas au bord final */
    
    /* LA MAGIE EST ICI : On force la zone de défilement à être arrondie */
    border-radius: 0 0 12px 12px !important; /* Mets 15px ou 8px si ton arrondi de base est différent */
    
    flex-wrap: nowrap !important; 
}

/* Sur mobile, on adapte pour les marges plus fines (10px) */
@media (max-width: 768px) {
    .tabs-container {
        margin-left: -10px !important;
        margin-right: -10px !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        border-radius: 0 !important; /* Sur mobile on touche le bord de l'écran, pas d'arrondi */
    }
}


/* =======================================================
   🤖 ONGLET SYNTHÈSE IA ET AJUSTEMENTS MOBILES
   ======================================================= */

/* 1. Relooking de la Synthèse IA (Design Newsletter) */
#syntheses-content-container {
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 10px;
}

#synth-24h, #synth-7j {
    background: var(--panel) !important;
    border: 1px solid var(--border) !important;
    border-radius: 8px !important;
    padding: 15px 20px !important;
    margin-bottom: 15px !important;
    /* 🌟 LE SECRET : Annule le "pre-wrap" qui transformait le code HTML de l'IA en vilains sauts de ligne */
    white-space: normal !important; 
}

/* 2. Nettoyage radical des marges des textes IA */
#synth-24h p, #synth-24h ul, #synth-24h li,
#synth-7j p, #synth-7j ul, #synth-7j li {
    margin-top: 4px !important;
    margin-bottom: 4px !important;
    font-size: 1em !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    background: transparent !important;
    border-left: none !important;
}

/* Restauration du retrait naturel pour les listes à puces */
#synth-24h ul, #synth-7j ul {
    padding-left: 25px !important;
}

/* 3. Masquage ultra-ciblé des filtres du Radar sur mobile */
@media (max-width: 768px) {
    /* On cache recherche, tri, durée, UTC/LOC et le texte "Filtre:" */
    #search-veille,
    .filter-date,
    #sort-select,
    .toggle-container,
    .filter-label {
        display: none !important;
    }
    
    /* Le conteneur des étoiles (.star-filter-container) reste visible ! */
    
    #syntheses-content-container {
        padding: 0 5px !important;
    }
}

/* =======================================================
   📱 TRANSFORMATION BOUTON DÉCONNEXION EN ICÔNE (MOBILE)
   ======================================================= */
@media (max-width: 768px) {
    .btn-logout {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        border-radius: 8px !important;
    }
    
    .btn-logout .btn-text {
        display: none !important; /* Masque le mot "Déconnexion" */
    }
    
    .btn-logout .btn-icon {
        display: block !important; /* Affiche le symbole ⏻ */
        font-size: 1.2em;
    }
}

/* =======================================================
   🛰️ ESPACEMENT RÉDUIT POUR LE RADAR DE VEILLE
   ======================================================= */
.titre-us {
    font-size: 0.85em !important;
    color: #94a3b8 !important;
    font-weight: 500 !important;
    margin-top: 2px !important;
    margin-bottom: 2px !important;
}

.resume-text {
    font-size: 0.85em !important;
    line-height: 1.5 !important;
    color: rgba(255, 255, 255, 0.85) !important;
    max-width: none !important; 
    background: rgba(255,255,255,0.02) !important; 
    border-left: 3px solid #475569 !important; 
    border-radius: 0 6px 6px 0 !important;
    padding: 8px 10px !important;
    margin-top: 4px !important;
    margin-bottom: 2px !important;
}

/* Icône d'édition spécifique au radar (alignée avec les étoiles) */
.edit-icon-veille {
    opacity: 0.3;
    font-size: 1.1em;
    cursor: pointer;
    transition: 0.2s;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.edit-icon-veille:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Icône de lien externe (Newsletter) */
.link-icon {
    margin-left: 10px;
    font-size: 0.85em;
    text-decoration: none;
    opacity: 0.3; /* Discret par défaut */
    display: inline-block;
    transition: 0.2s ease-in-out;
}

.link-icon:hover {
    opacity: 1; /* Pleine couleur au survol */
    transform: scale(1.2); /* Grossit légèrement */
}