/* css/style.css */

:root {
    /* Variables statiques */
    --light-gray: #f0f2f5;
    --col-new-item: #fffae6; 
}

* { box-sizing: border-box; }
body { 
    font-family: 'Trebuchet MS', sans-serif; 
    background-color: var(--light-gray); 
    margin: 0; 
    color: #333; 
    overscroll-behavior-y: none; /* Toujours là pour empêcher le rebond */
}

/* 1. LE RIDEAU MAGIQUE : Il crée un fond blanc fixe derrière l'heure de l'iPhone */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: env(safe-area-inset-top);
    background-color: var(--white); /* Même couleur que le header */
    z-index: 9999; /* Par-dessus tout le reste */
}

.hidden { display: none !important; }
.text-center { text-align: center; }

/* HEADER */
header { 
    background: var(--white); 
    padding: 15px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    position: sticky; 
    top: env(safe-area-inset-top); /* Bloque le menu juste sous la zone de l'heure */
	margin-top: env(safe-area-inset-top);
    z-index: 100; 
}
.app-title { color: var(--blue); font-size: 1.2rem; font-weight: bold; cursor: pointer; text-decoration: none; }
.logout-btn { color: var(--gray); font-size: 1.2rem; }
.sub-header { background: #e0e0e0; padding: 10px 20px; display: flex; align-items: center; height: 45px; }
.back-btn { color: var(--gray); font-size: 1.2rem; cursor: pointer; border: none; background: none; }
.info-btn-in-title { background: none; border: none; font-size: 1.2rem; color: var(--blue); cursor: pointer; margin-left:10px; }
.info-btn-in-title:hover { color: var(--green); }
.clickable-title { cursor: pointer; transition: color 0.2s; } .clickable-title:hover { color: var(--blue) !important; }

/* LOGIN & LAYOUT */
#main-container { 
    padding: 20px; 
    max-width: 800px; 
    margin: 0 auto; 
    min-height: 80dvh; /* 👈 REMPLACE 80vh PAR 80dvh */
}
.login-box { background: var(--white); padding: 30px; border-radius: 10px; margin-top: 50px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.login-box input { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid var(--gray); border-radius: 5px; }
.btn-primary { background: var(--blue); color: white; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; width: 100%; }
.btn-secondary { background: white; color: #555; border: 1px solid #ccc; padding: 10px 20px; border-radius: 5px; cursor: pointer; width: auto; font-size: 0.9rem; }
.btn-secondary:hover { background: #f0f0f0; }
.modal-buttons { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; } 

/* MENU GRID */
.grid-menu { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 20px; }
.menu-item { 
    background: var(--white); 
    border-radius: 15px; 
    padding: 25px 10px; 
    text-align: center; 
    cursor: pointer; 
    transition: transform 0.2s; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.05); 
    color: var(--gray); 
    position: relative; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}
.menu-item:hover { transform: translateY(-3px); }
.menu-item i { font-size: 2.2rem; margin-bottom: 10px; display: block; }
.notification-badge { position: absolute; top: 10px; right: 20px; background: var(--red-badge); color: white; border-radius: 50%; width: 24px; height: 24px; display: flex; justify-content: center; align-items: center; font-size: 0.75rem; font-weight: bold; }

/* COULEURS ICONES MENU */
.item-activity i { color: var(--col-activity); } .item-messaging i { color: var(--col-msg); } .item-agenda i { color: var(--col-agenda); } .item-homework i { color: var(--col-homework); } .item-docs i { color: var(--col-docs); } .item-admin i { color: var(--col-admin); } 
.item-tasks i { color: var(--col-tasks); } .item-health i { color: var(--col-health); } .item-extra i { color: var(--col-extra); } .item-tools i { color: var(--col-tools); } .item-finance i { color: var(--col-finance); } .item-notes i { color: var(--col-notes); }

/* LISTES & ITEMS */
.activity-list, .topic-list, .file-list, .admin-list, .homework-list, .task-list { background: var(--white); border-radius: 8px; overflow: hidden; }
.activity-item, .topic-item, .file-item, .admin-item, .homework-item, .task-item { padding: 15px; border-bottom: 1px solid #eee; cursor: pointer; display: flex; align-items: center; transition: background-color 0.2s; }
.item-new { background-color: var(--col-new-item); }
.new-badge { background: var(--green); color: white; padding: 2px 6px; border-radius: 4px; font-size: 0.7rem; font-weight: bold; margin-left: 10px; }
.act-icon { margin-right: 15px; font-size: 1.2rem; }

/* COULEURS DYNAMIQUES ET SURVOL (TRANSPARENCE 60%) */
.item-type-health { border-left: 5px solid var(--col-health) !important; }
.item-type-health .act-icon { color: var(--col-health); }
.item-type-health:hover { background-color: color-mix(in srgb, var(--col-health), white 60%) !important; }

.item-type-tasks { border-left: 5px solid var(--col-tasks) !important; }
.item-type-tasks .act-icon { color: var(--col-tasks); }
.item-type-tasks:hover { background-color: color-mix(in srgb, var(--col-tasks), white 60%) !important; }

.item-type-extra { border-left: 5px solid var(--col-extra) !important; }
.item-type-extra .act-icon { color: var(--col-extra); }
.item-type-extra:hover { background-color: color-mix(in srgb, var(--col-extra), white 60%) !important; }

.item-type-homework, .item-type-scola { border-left: 5px solid var(--col-homework) !important; }
.item-type-homework .act-icon, .item-type-scola .act-icon { color: var(--col-homework); }
.item-type-homework:hover, .item-type-scola:hover { background-color: color-mix(in srgb, var(--col-homework), white 60%) !important; }

.item-type-message { border-left: 5px solid var(--col-msg) !important; }
.item-type-message .act-icon { color: var(--col-msg); }
.item-type-message:hover { background-color: color-mix(in srgb, var(--col-msg), white 60%) !important; }

.item-personal i { color: var(--col-personal); }

.item-type-personal { border-left: 5px solid var(--col-personal) !important; }
.item-type-personal .act-icon { color: var(--col-personal); }
.item-type-personal:hover { background-color: color-mix(in srgb, var(--col-personal), white 60%) !important; }

.task-item.item-type-personal .task-checkbox { color: var(--col-personal); }

.topic-item { border-left-width: 5px; border-left-style: solid; }
.doc-item-row:hover { background-color: var(--hover-color, #f9f9f9) !important; }

/* MESSAGERIE */
.topic-unread { background: var(--green); color: white; padding: 2px 8px; border-radius: 10px; font-size: 0.8rem; }
.topic-actions { display: flex; gap: 8px; align-items: center; }
.topic-pinned { color: var(--green); transform: rotate(45deg); font-size: 0.9rem; margin-right: 5px; } .topic-unpinned { color: #ccc; font-size: 0.9rem; margin-right: 5px; }
.chat-container { 
    display: flex; 
    flex-direction: column; 
    height: calc(100dvh - 230px); 
    position: relative;
}
.messages-area { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 15px; background: #e5e5e5; border-radius: 8px; }
.message-bubble { max-width: 80%; padding: 10px 15px; border-radius: 15px; font-size: 0.95rem; word-wrap: break-word; box-shadow: 0 1px 2px rgba(0,0,0,0.1); position: relative; }
.msg-me { align-self: flex-end; background: var(--blue); color: white; border-bottom-right-radius: 2px; } .msg-other { align-self: flex-start; background: var(--gray); color: white; border-bottom-left-radius: 2px; }
.msg-file { background: rgba(255,255,255,0.2); padding: 8px; margin-bottom: 5px; border-radius: 5px; display: flex; align-items: center; gap: 8px; color: white; text-decoration: none; font-weight: bold; }
.msg-deleted { background: rgba(0,0,0,0.2); padding: 5px 10px; border-radius: 5px; display: inline-block; font-style: italic; font-size: 0.8rem; color: #fff; margin-bottom: 5px;}
.msg-tools { margin-left:10px; display:inline-block; opacity:0.7; } .msg-tools i { cursor:pointer; margin-left:5px; font-size:0.8rem; }
.fa-check-double { color: white !important; } .read-info { display: block; font-size:0.7rem; margin-top:5px; text-align:right; opacity:0.8; }
.chat-input-wrapper { background: var(--white); border-radius: 8px; margin-top: 10px; overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; flex-direction: column; }
.chat-textarea { width: 100%; border: none; padding: 15px; resize: none; outline: none; font-family: inherit; min-height: 150px; }
.chat-toolbar { background-color: #f8f9fa; border-top: 1px solid #eee; padding: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.chat-tools-left { display: flex; align-items: center; gap: 10px; flex-grow: 1; flex-wrap:wrap; }
.file-label { cursor: pointer; color: #555; background: white; border: 1px solid #ccc; padding: 5px 10px; border-radius: 4px; font-size: 0.85rem; display: flex; align-items: center; gap: 5px; transition: 0.2s; }
.folder-select { padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85rem; background: white; max-width: 140px; }
.custom-name-input { padding: 6px; border: 1px solid #ccc; border-radius: 4px; font-size: 0.85rem; width: 150px; }

/* DOCUMENTS */
.doc-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.view-toggle-btn { background: white; border: 1px solid #ccc; padding: 5px 10px; cursor: pointer; border-radius: 4px; color: var(--gray); } .view-toggle-btn.active { background: var(--blue); color: white; border-color: var(--blue); }
.folder-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.folder-item { background: var(--white); border-radius: 15px; padding: 25px 10px; text-align: center; cursor: pointer; transition: transform 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.05); color: var(--gray); position: relative; border: 1px solid #eee; } .folder-item:hover { transform: translateY(-3px); }
.folder-item i { font-size: 2.2rem; margin-bottom: 10px; display: block; color: var(--col-docs); }
.folder-list-mode { display: flex; flex-direction: column; gap: 10px; }
.folder-list-item { background: var(--white); border-radius: 8px; padding: 15px; display: flex; align-items: center; justify-content: space-between; box-shadow: 0 1px 3px rgba(0,0,0,0.1); cursor: pointer; } .folder-list-item:hover { background-color: #f9f9f9; }
.folder-list-left { display: flex; align-items: center; gap: 15px; flex: 1; }
.folder-list-icon { font-size: 1.5rem; color: var(--col-docs); }
.folder-actions { display: flex; gap: 5px; }
.btn-delete { background: white; border: 1px solid #e74c3c; color: #e74c3c; border-radius: 4px; padding: 5px 10px; cursor: pointer; transition: 0.2s; } .btn-delete:hover { background: #e74c3c; color: white; }
.btn-edit { background: white; border: 1px solid var(--blue); color: var(--blue); border-radius: 4px; padding: 5px 10px; cursor: pointer; transition: 0.2s; margin-right:5px; } .btn-edit:hover { background: var(--blue); color: white; }
.btn-restore { background: white; border: 1px solid var(--green); color: var(--green); border-radius: 4px; padding: 5px 10px; cursor: pointer; transition: 0.2s; } .btn-restore:hover { background: var(--green); color: white; }
.pin-btn { background: none; border: none; cursor: pointer; padding: 0; margin-right: 5px; }
.fab { position: fixed; bottom: 20px; right: 20px; color: white; width: 55px; height: 55px; border-radius: 50%; display: flex; justify-content: center; align-items: center; box-shadow: 0 4px 6px rgba(0,0,0,0.2); cursor: pointer; font-size: 1.5rem; z-index: 50; transition: background-color 0.3s ease; }

/* TASKS & HOMEWORK */
.homework-item, .task-item { display: flex; align-items: center; justify-content: space-between; } 
.hw-checkbox { font-size: 1.5rem; color: #ccc; margin-right: 15px; cursor: pointer; width: 30px; text-align: center; } .hw-checkbox.checked { color: var(--green); }
.task-checkbox { font-size: 1.5rem; color: #ccc; margin-right: 15px; cursor: pointer; width: 30px; text-align: center; } .task-checkbox.checked { color: var(--green); }
.hw-content { flex: 1; } .hw-done .hw-text { text-decoration: line-through; color: #aaa; }
.task-content-text.checked { text-decoration: line-through; color: #aaa; } .task-done .task-content-text { text-decoration: line-through; color: #aaa; }
.hw-actions { display: flex; gap: 10px; margin-top: 5px; align-items: center; }
#homework-list-past .homework-item { opacity: 0.6; filter: grayscale(0.5); transition: all 0.3s; } #homework-list-past .homework-item:hover { opacity: 1; filter: grayscale(0); }
.btn-action { background: white; border: 1px solid #ccc; padding: 5px 10px; border-radius: 4px; cursor: pointer; margin-left: 5px; font-size: 0.9rem; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; height: 30px; width: 35px; }
.btn-blue { border-color: var(--blue); color: var(--blue); } .btn-blue:hover { background: var(--blue); color: white; }
.btn-red { border-color: #e74c3c; color: #e74c3c; } .btn-red:hover { background: #e74c3c; color: white; }
.act-tools { margin-left: auto; display: flex; gap: 5px; }
.btn-edit-small { background: none; border: 1px solid var(--blue); color: var(--blue); border-radius: 3px; padding: 2px 5px; cursor: pointer; font-size: 0.7rem; } .btn-edit-small:hover { background: var(--blue); color: white; }
.btn-delete-small { background: none; border: 1px solid #e74c3c; color: #e74c3c; border-radius: 3px; padding: 2px 5px; cursor: pointer; font-size: 0.7rem; } .btn-delete-small:hover { background: #e74c3c; color: white; }
details { margin-top: 20px; background: #fff; border-radius: 8px; overflow: hidden; } summary { padding: 15px; background: #e0e0e0; cursor: pointer; font-weight: bold; color: #666; outline: none; } summary:hover { background: #dcdcdc; }
.subtask-list { margin-top: 15px; background: #f9f9f9; padding: 10px; border-radius: 5px; } .subtask-item { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid #eee; background: white; }
.subtask-check { margin-right: 10px; cursor: pointer; color: #ccc; font-size: 1.5rem; } .subtask-check.checked { color: var(--green); }
.subtask-text { flex: 1; } .subtask-text.checked { text-decoration: line-through; color: #aaa; }
.drag-handle { cursor: grab; color: #ccc; margin-right: 10px; } .task-item { background: white; border: 1px solid #eee; margin-bottom: 5px; border-radius: 5px; }
.health-section-title { color: var(--col-health); font-size: 1rem; margin-top: 20px; border-bottom: 1px solid #eee; padding-bottom: 5px; }

/* TASK TYPES (borders) */
.task-item.item-type-general .task-checkbox { color: var(--col-tasks); } 
.task-item.item-type-health .task-checkbox { color: var(--col-health); } 
.task-item.item-type-extra .task-checkbox { color: var(--col-extra); } 
.task-item.item-type-homework .task-checkbox { color: var(--col-homework); }
.task-item.task-done .task-checkbox { opacity: 0.5; }

/* SWITCH & ADMIN */
.switch-field { display: flex; margin-bottom: 15px; overflow: hidden; } .switch-field input { position: absolute !important; clip: rect(0, 0, 0, 0); height: 1px; width: 1px; border: 0; overflow: hidden; }
.switch-field label { background-color: #e4e4e4; color: rgba(0, 0, 0, 0.6); font-size: 14px; line-height: 1; text-align: center; padding: 8px 16px; margin-right: -1px; border: 1px solid rgba(0, 0, 0, 0.2); box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px rgba(255, 255, 255, 0.1); transition: all 0.1s ease-in-out; flex: 1; cursor: pointer; }
.switch-field label:first-of-type { border-radius: 4px 0 0 4px; } .switch-field label:last-of-type { border-radius: 0 4px 4px 0; }
.switch-field input:checked + label { background-color: var(--col-health); color: #fff; box-shadow: none; }
.modal-theme-extra .switch-field input:checked + label { background-color: var(--col-extra) !important; }
.admin-switch input:checked + label { background-color: var(--blue) !important; }

.admin-nav { display: flex; gap: 10px; margin-bottom: 20px; } .admin-tab { flex: 1; padding: 10px; text-align: center; background: #ddd; color: #555; border-radius: 5px; cursor: pointer; font-weight: bold; } .admin-tab.active { background: var(--blue); color: white; }
.admin-mobile-select { width: 100%; padding: 10px; border-radius: 5px; border: 1px solid #ccc; display: none; margin-bottom: 20px; }
.admin-list-item { background: white; padding: 15px; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; } .admin-list-item input, .admin-list-item select { padding: 5px; border: 1px solid #ddd; border-radius: 4px; margin-right: 5px; }
.btn-small { padding: 5px 10px; font-size: 0.8rem; cursor: pointer; border-radius: 3px; border: none; } .btn-green { background: var(--green); color: white; } .btn-red { background: #e74c3c; color: white; }
.trash-toggle { margin-bottom: 10px; text-align: right; display:flex; justify-content:flex-end; gap:10px; }
.date-type-switch { margin-bottom: 10px; display:flex; align-items:center; gap:10px; font-size:0.9rem; }
.ql-editor { min-height: 200px; }
.ql-editor img { max-width: 100%; height: auto; border-radius: 5px; }
h2 { color: var(--blue); border-bottom: 2px solid var(--green); padding-bottom: 5px; margin-top: 0; display: flex; justify-content: space-between; align-items: center; }

.admin-card { background:white; border:1px solid #ddd; padding:15px; border-radius:8px; margin-bottom:15px; }
.admin-card h4 { margin-top:0; color:var(--blue); border-bottom:1px solid #eee; padding-bottom:5px; margin-bottom:15px; }
.folder-picker { width:100%; padding:10px; border:1px solid #ddd; border-radius:5px; margin-bottom:15px; background:white; }

/* CSS Color Settings */
.color-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px dashed #eee; }
.color-row input[type="color"] { border:none; padding:0; width:40px; height:30px; cursor:pointer; background:none; }
.color-row label { font-size: 0.9rem; color: #555; }

/* TOOLS & DICTATION */
.audio-player-bar { background: #f1f3f4; padding: 10px; border-radius: 50px; display: flex; align-items: center; justify-content: center; gap: 15px; margin-bottom: 20px; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.audio-btn { background: white; border: 1px solid #ddd; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: 0.2s; color: var(--blue); }
.audio-btn:hover { background: var(--blue); color: white; }
.audio-btn-large { width: 50px; height: 50px; font-size: 1.2rem; background: var(--blue); color: white; border: none; }
.audio-btn-large:hover { background: var(--green); }
.speed-control { display: flex; align-items: center; gap: 5px; font-size: 0.8rem; color: #666; }
.speed-control input { width: 60px; }
.dictation-text-display { background: #fff; padding: 20px; border: 1px solid #ddd; border-radius: 8px; font-size: 1.1rem; line-height: 1.6; margin-bottom: 20px; font-family: 'Georgia', serif; color: #333; }

/* Boutons Dictée 50/50 */
.dictation-btn-group { display: flex; gap: 10px; width: 100%; }
.dictation-btn-group button { flex: 1; }

/* --- STYLE MODULE NOTES --- */

/* Grille et Cartes de notes */
.note-card {
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 180px;
    overflow: hidden;
}
.note-card:hover { transform: translateY(-3px); box-shadow: 0 5px 10px rgba(0,0,0,0.15); }
.note-title { font-weight: bold; font-size: 1.1rem; margin-bottom: 10px; color: #333; }
.note-preview { font-size: 0.9rem; color: #666; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; flex:1; }
.note-footer {
    display: flex;
    justify-content: flex-start; /* Aligne les éléments à gauche */
    gap: 15px; /* Définit l'espace exact entre les deux span */
    align-items: center;
    
    /* Styles cosmétiques */
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.05);
    font-size: 0.8rem;
    color: #666;
}

/* Modal d'édition (Le problème d'affichage actuel) */
.note-modal-card {
    background: var(--white);
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    overflow: hidden;
    animation: fadeInScale 0.2s ease-out;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.note-modal-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}

.note-input-title {
    font-size: 1.4rem;
    font-weight: bold;
    border: none;
    outline: none;
    width: 100%;
    color: var(--blue);
    background: transparent;
}

.note-meta-line {
    padding: 5px 20px;
    font-size: 0.8rem;
    color: #888;
    background: #fafafa;
    border-bottom: 1px solid #eee;
    min-height: 30px;
    display: flex; align-items: center;
}

.note-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Boutons icônes ronds */
.icon-btn-primary, .icon-btn-danger, .icon-btn-close {
    width: 36px; height: 36px;
    border-radius: 50%; border: none;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: 0.2s; font-size: 1rem; margin-left: 5px;
}
.icon-btn-primary { background: var(--blue); color: white; }
.icon-btn-primary:hover { background: var(--green); }
.icon-btn-danger { background: #fee; color: #e74c3c; }
.icon-btn-danger:hover { background: #e74c3c; color: white; }
.icon-btn-close { background: #f0f0f0; color: #555; }
.icon-btn-close:hover { background: #ddd; color: #000; }

/* Sélecteur de couleur */
.color-picker-row { display: flex; gap: 10px; }
.color-option { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; border: 2px solid #ddd; transition: transform 0.2s; }
.color-option.selected { border-color: #333; transform: scale(1.1); }

/* Historique & Editeur */
.note-modal-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: #666;
    max-height: 150px;
    overflow-y: auto;
}
#note-history-list { list-style: none; padding: 0; margin: 0; }
#note-history-list li { margin-bottom: 4px; padding-bottom: 4px; border-bottom: 1px dashed #eee; }
#note-quill-container { border: none !important; height: 300px; }
.ql-toolbar { border: none !important; border-bottom: 1px solid #eee !important; }

/* En-têtes de modules standards */
.module-header {
    font-family: 'Trebuchet MS', sans-serif;
    color: #91999F; /* Votre gris personnalisé */
    margin: 0;
	margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px; /* Espace entre le texte et le bouton info */
}

/* Variante pour les en-têtes avec listes déroulantes (Santé, Scolarité) */
.module-header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #00A3E0; /* Ligne de séparation bleue */
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* Ligne d'en-tête du Dashboard (2/3 et 1/3) */
.dashboard-header-row { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 15px; /* Ajustez à 20px si votre grille du bas utilise 20px */
    margin-bottom: 15px; /* Même chose ici */
    align-items: stretch; /* Force les blocs à avoir la même hauteur (corrige l'espace vertical) */
}
.dashboard-widget { background: white; border-radius: 8px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); padding: 20px; border: 1px solid #e0e0e0; }
.widget-2-3 { 
    grid-column: span 2; 
    display: flex; 
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    margin: 0 !important; /* Annule la marge native des menu-item */
    height: 100%;
}
.widget-1-3 { 
    grid-column: span 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: center; 
    align-items: center; 
    margin: 0 !important; /* Annule la marge native des menu-item */
    height: 100%;
}

/* Contenu du Widget Météo Accueil */
#ww-city { font-weight: bold; color: var(--gray); font-size: 1.1rem; text-align: center; margin-bottom: 10px; }
.ww-main { display: flex; justify-content: center; align-items: center; gap: 15px; margin-bottom: 5px; }
#ww-icon { font-size: 3rem; color: var(--blue); }
#ww-temp { font-size: 2.8rem; font-weight: bold; color: var(--blue); line-height: 1; }
#ww-desc { color: #333; font-size: 0.95rem; font-weight: bold; text-align: center; }
.ww-minmax { color: var(--gray); font-size: 0.8rem; text-align: center; margin-top: 5px; }

/* Page Météo Détaillée */
.weather-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.w-full { grid-column: 1 / -1; }
.weather-card { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid #eee; }
.weather-card-title { color: var(--gray); font-size: 1.1rem; margin-top: 0; margin-bottom: 15px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid #f0f2f5; padding-bottom: 10px; }
.weather-stat-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed #f0f2f5; font-size: 0.9rem; }
.weather-stat-row:last-child { border-bottom: none; }

/* Scroll horizontal horaire */
.weather-hourly-scroll { display: flex; gap: 15px; overflow-x: auto; padding-bottom: 10px; -webkit-overflow-scrolling: touch; }
.hourly-item { display: flex; flex-direction: column; align-items: center; min-width: 70px; padding: 10px; background: #f8f9fa; border-radius: 8px; font-size: 0.85rem; }
.hourly-item i { font-size: 1.5rem; color: var(--blue); margin: 8px 0; }

/* Liste 10 jours */
.daily-item { display: grid; grid-template-columns: 80px 40px 1fr 80px; align-items: center; padding: 12px 0; border-bottom: 1px solid #eee; font-size: 0.9rem; }
.daily-item:last-child { border-bottom: none; }
.daily-item i { font-size: 1.2rem; color: var(--blue); text-align: center; }

/* Boussole Vent */
.wind-compass { width: 70px; height: 70px; border-radius: 50%; border: 3px solid #f0f2f5; position: relative; display: flex; justify-content: center; align-items: center; background: white; }
.wind-compass::before { content: 'N'; position: absolute; top: -5px; font-size: 10px; color: var(--gray); background: white; padding: 0 2px; }
#wt-wind-arrow { font-size: 1.5rem; color: var(--blue); transition: transform 0.5s; }

/* Badge AQI */
.aqi-badge { padding: 5px 15px; border-radius: 20px; color: white; font-weight: bold; font-size: 1rem; }

/* Alertes */
.weather-alerts-container { margin-bottom: 20px; display: flex; flex-direction: column; gap: 10px; }
.weather-alert { padding: 15px; border-radius: 5px; color: white; font-weight: bold; display: flex; align-items: center; gap: 10px; }
.alert-red { background: #e74c3c; }
.alert-orange { background: #e67e22; }
.alert-purple { background: #9b59b6; }

/* Conteneur principal du widget */
.widget-2-3 {
    position: relative; /* Indispensable pour le positionnement absolu du fond */
    overflow: hidden;
    background-color: #fff; /* À adapter selon votre thème */
    padding: 20px;
    border-radius: 8px;
}

/* Date en filigrane (fond de la case) */
.widget-2-3 .widget-date-watermark {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5.5rem; /* Taille imposante mais discrète */
    font-weight: 800;
    color: rgba(0, 0, 0, 0.03); /* Opacité très faible pour la subtilité */
    pointer-events: none; /* Évite que le texte soit sélectionnable */
    user-select: none;
    z-index: 1;
}

/* Corps du widget pour passer au-dessus du filigrane */
.widget-2-3 .widget-body {
    position: relative;
    z-index: 2; 
}

/* Titres des sections */
.widget-2-3 .widget-title {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #718096;
    margin-bottom: 8px;
}

/* Séparateur horizontal stylisé */
.widget-2-3 .widget-separator {
    border: 0;
    height: 1px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.08), transparent);
    margin: 20px 0;
}
		
/* --- BOÎTE DE SUGGESTION IA --- */
.ai-suggestion-box {
    position: absolute; /* Flotte par-dessus la zone de chat */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Recouvre les messages ET la zone de saisie */
    z-index: 100;
    background-color: rgba(255, 245, 245, 0.96); /* Fond presque opaque */
    backdrop-filter: blur(4px); /* Floute l'arrière-plan (messages et textarea) */
    padding: 20px;
    box-sizing: border-box;
    border: 1px solid #fbc4c4;
    border-top: 5px solid #c53030;
    border-radius: 8px;
    overflow-y: auto; /* Ajoute un scroll interne si le texte de l'IA est très long */
    font-family: 'Trebuchet MS', sans-serif;
    color: #c53030;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Supprime les marges par défaut des paragraphes pour un espacement naturel */
#dt-desc p, 
#finance-detail-desc p, 
#module-info-content p, 
.note-preview p,
.msg-content p {
	margin-bottom: 0.8em !important;
    margin: 0;
    padding: 0;
}

.msg-content p:last-child {
    margin-bottom: 0 !important;
}

.mobile-only { display: none !important; }

/* --- BOUTON ET BADGE POUCE LEVÉ (MESSAGERIE) --- */
.msg-like-btn {
    cursor: pointer;
    margin-left: 8px;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    transition: transform 0.2s ease, color 0.2s ease;
    display: inline-block;
}

.msg-like-btn:hover {
    transform: scale(1.25);
    color: #fff;
}

.msg-like-btn.active {
    color: var(--green) !important;
    filter: drop-shadow(0 0 2px rgba(0,0,0,0.3));
}

.msg-like-badge {
    margin-left: 8px;
    font-size: 0.9rem;
    color: var(--green);
}

/* --- CUSTOM QUILL CHAT MESSAGERIE --- */
#chat-quill-wrapper .ql-toolbar {
    border: none;
    border-bottom: 1px solid #eee !important;
    background-color: #fcfcfc;
}

#chat-quill-wrapper .ql-container {
    border: none;
    font-family: 'Trebuchet MS', sans-serif;
    font-size: 0.95rem;
}

#chat-quill-wrapper .ql-editor {
    min-height: 120px;
    max-height: 300px; /* Ajoute une barre de défilement si le texte est très très long */
}

/* Ajustements pour les éditeurs Quill "Le savais-tu ?" */
#dyk-details-quill-container .ql-editor, 
#edit-dyk-quill-container .ql-editor {
	min-height: 100px;
	max-height: 250px;
	overflow-y: auto;
}		
@media (max-width: 600px) { .admin-nav { display: none; } .admin-mobile-select { display: block; } .grid-menu { grid-template-columns: repeat(2, 1fr); } .chat-tools-left { gap: 5px; } .custom-name-input { width: 100px; } }

@media (max-width: 768px) {
    .dashboard-header-row {
        grid-template-columns: 1fr;
    }
    .widget-2-3, .widget-1-3 {
        grid-column: span 1;
    }
	.chat-hint-text {
        display: none !important;
    }
    .ai-suggestion-box {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100dvh;
        z-index: 3000;
        margin: 0;
        border-radius: 0;
        border-top: 5px solid #c53030;
        border-left: none;
        overflow-y: auto;
        box-sizing: border-box;
        padding: 20px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.3);
        background-color: #fff5f5;
    }
	#modal-task {
        align-items: stretch !important;
        padding: 0 !important;
    }
    #modal-task > div {
        width: 100% !important;
        max-width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
        box-sizing: border-box;
    }
	.chat-textarea {
	min-height: 75px;	
	}
	.mobile-only { display: block !important; }
    .hide-on-mobile { display: none !important; }
    .hide-on-mobile.show-on-mobile { display: flex !important; }
}