@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', system-ui, sans-serif;
    font-size: 17px;
    background-color: #1c003b;
    color: #ffffff;
    overflow-x: hidden;
}

#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.5s ease-out;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

#app {
    position: relative;
    z-index: 1;
}

#ui-container {
    position: relative;
    min-height: 100vh;
    padding: 24px 36px 48px;
}

.header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 40px;
}

.navigation {
    display: flex;
    justify-content: center;
    margin: 2.5rem 0 2.5rem 0;
}

.nav-buttons {
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border-radius: 50px;
    padding: 4px;
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.nav-buttons::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.nav-buttons:hover::before {
    left: 100%;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    padding: 12px 24px;
    border-radius: 44px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 44px;
}

.nav-btn:hover::before {
    opacity: 1;
}

.nav-btn:hover {
    color: rgba(255, 255, 255, 0.9);
    transform: translateY(-1px);
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 
        0 6px 25px rgba(102, 126, 234, 0.4),
        0 2px 10px rgba(118, 75, 162, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: gentle-pulse 2s ease-in-out infinite;
}

.nav-btn.active::before {
    display: none;
}

@keyframes gentle-pulse {
    0%, 100% {
        box-shadow: 
            0 6px 25px rgba(102, 126, 234, 0.4),
            0 2px 10px rgba(118, 75, 162, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        box-shadow: 
            0 8px 30px rgba(102, 126, 234, 0.6),
            0 4px 15px rgba(118, 75, 162, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
}

.nav-icon {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.nav-text {
    font-weight: 600;
}

/* Styles pour les liens de navigation */
a.nav-btn {
    text-decoration: none;
}

a.nav-btn:hover {
    text-decoration: none;
}

.content-section {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.content-section.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Responsive pour les boutons de navigation */
@media (max-width: 768px) {
    .nav-buttons {
        width: 100%;
        max-width: 400px;
    }
    
    .nav-btn {
        flex: 1;
        justify-content: center;
        padding: 12px 16px;
    }
    
    .nav-icon {
        font-size: 1rem;
    }
    
    .nav-text {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .nav-btn {
        padding: 10px 12px;
        gap: 6px;
    }
    
    .nav-text {
        font-size: 0.85rem;
    }
}

.header h1 {
    font-size: 3rem;
    font-weight: 100;
    letter-spacing: 3px;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #ffffff, #cccccc);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.search-container {
    max-width: 500px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    align-items: center;
}

#search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: #ffffff;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

#search-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.shuffle-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.shuffle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: rotate(180deg) scale(1.1);
}

.shuffle-btn:active {
    transform: rotate(180deg) scale(0.95);
}

.message-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 36px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 0;
}

.exercise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 36px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 0;
}

.message-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 22px;
    padding: 34px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.message-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: rotate(-45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.message-card:hover::before {
    animation: shimmer 1.5s ease-in-out;
}

@keyframes shimmer {
    0% { transform: translateX(-100%) translateY(-100%) rotate(-45deg); opacity: 0; }
    50% { opacity: 1; }
    100% { transform: translateX(100%) translateY(100%) rotate(-45deg); opacity: 0; }
}

.message-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
}

.exercise-card {
    background: rgba(102, 126, 234, 0.1);
    border-radius: 22px;
    padding: 34px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.exercise-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.exercise-card:hover::before {
    opacity: 1;
}

.exercise-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(102, 126, 234, 0.2);
    border-color: rgba(102, 126, 234, 0.4);
    background: rgba(102, 126, 234, 0.15);
}

.exercise-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.exercise-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 1.2rem;
}

.exercise-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
}

.exercise-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 15px;
}

.exercise-duration {
    display: inline-block;
    background: rgba(102, 126, 234, 0.3);
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

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

.message-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 6px;
}

.message-date {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}

.message-preview {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.message-tags {
    margin-top: 22px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag {
    background: rgba(255, 255, 255, 0.1);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-detail {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.message-detail.visible {
    opacity: 1;
    visibility: visible;
}

.message-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    padding: 48px 52px;
    max-width: min(92vw, 1040px);
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    backdrop-filter: blur(20px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
}

.close-btn {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    font-size: 1.8rem;
    color: #ffffff;
    cursor: pointer;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.message-content h1,
.message-content h2,
.message-content h3 {
    color: #ffffff;
    margin-bottom: 15px;
    margin-top: 25px;
}

.message-content h1 {
    font-size: 2.2rem;
    margin-top: 0;
    font-weight: 700;
}

.message-content p {
    line-height: 1.8;
    font-size: 1.05rem;
    margin-bottom: 16px;
    color: rgba(255, 255, 255, 0.9);
}

.message-content ul,
.message-content ol {
    margin: 15px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.9);
}

.message-content code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.message-content pre {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    border-left: 3px solid rgba(255, 255, 255, 0.3);
}

.hidden {
    display: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    #ui-container {
        padding: 16px 14px 36px;
    }

    .message-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .message-card {
        padding: 26px;
    }

    /* Modal plein écran sur mobile */
    .message-detail {
        align-items: flex-end;
        padding: 0;
    }

    .message-content {
        max-width: 100%;
        width: 100%;
        max-height: 95dvh;
        margin: 0;
        border-radius: 24px 24px 0 0;
        padding: 28px 22px 36px;
    }
}

@media (max-width: 640px) {
    /* Navigation : icônes uniquement pour gagner de la place */
    .nav-text {
        display: none;
    }

    .nav-btn {
        padding: 11px 14px;
        gap: 0;
    }

    .header {
        padding: 14px 16px;
        gap: 8px;
        margin-bottom: 20px;
    }

    /* Search prend l'espace restant */
    .header .search-container {
        min-width: 0;
        max-width: none;
        flex: 1;
    }

    #search-input {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    #ui-container {
        padding: 12px 10px 32px;
    }

    .message-content {
        padding: 24px 18px 32px;
        border-radius: 20px 20px 0 0;
    }

    .nav-btn {
        padding: 10px 12px;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Styles pour la navigation dans les messages */
.message-nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-message-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-message-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.nav-message-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.nav-message-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.message-position-indicator {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.message-detail-content {
    padding-top: 10px;
}

/* Animations pour le swipe */
.message-content {
    touch-action: pan-y;
    user-select: none;
}

@media (max-width: 768px) {
    .nav-message-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
    }
    
    .message-position-indicator {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .message-nav-container {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
}

/* Styles pour la section Planning */
.planning-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 8px 0 32px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.schedule-section,
.daily-tasks-section,
.stats-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 22px;
    padding: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.daily-tasks-section {
    grid-column: 1 / -1;
}

.schedule-section h2,
.daily-tasks-section h2,
.stats-section h2 {
    color: #ffffff;
    margin-bottom: 28px;
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
}

/* Emploi du temps */
.schedule-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.schedule-item {
    display: flex;
    align-items: center;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    border-left: 4px solid #6c5ce7;
    transition: all 0.3s ease;
}

.schedule-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateX(5px);
}

.schedule-time {
    font-weight: bold;
    color: #a29bfe;
    min-width: 120px;
    font-size: 0.9rem;
}

.schedule-activity {
    color: #ffffff;
    flex: 1;
}

/* En-tête des tâches */
.tasks-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.day-selector select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.day-selector option {
    background: #1c003b;
    color: #ffffff;
}

/* Grille des tâches */
.tasks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.task-item {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.task-item:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.task-item.completed {
    opacity: 0.7;
    background: rgba(76, 175, 80, 0.2);
    border-color: rgba(76, 175, 80, 0.5);
}

.task-item.completed .task-text {
    text-decoration: line-through;
}

.task-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    cursor: pointer;
}

.task-text {
    flex: 1;
    color: #ffffff;
    font-size: 1rem;
}

.task-priority {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
    margin-left: 10px;
}

.task-priority.high {
    background: rgba(231, 76, 60, 0.3);
    color: #e74c3c;
}

.task-priority.medium {
    background: rgba(241, 196, 15, 0.3);
    color: #f1c40f;
}

.task-priority.low {
    background: rgba(46, 204, 113, 0.3);
    color: #2ecc71;
}

.task-actions {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

.task-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #ffffff;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.task-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.add-task-btn {
    background: rgba(108, 92, 231, 0.3);
    border: 2px dashed rgba(108, 92, 231, 0.5);
    color: #6c5ce7;
    padding: 15px 25px;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.add-task-btn:hover {
    background: rgba(108, 92, 231, 0.5);
    border-color: rgba(108, 92, 231, 0.8);
    color: #ffffff;
}

/* Statistiques */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-item {
    text-align: center;
    padding: 28px 20px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: #6c5ce7;
    display: block;
}

.stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-top: 5px;
}

/* Modal pour tâches */
.task-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.task-modal.visible {
    opacity: 1;
    visibility: visible;
}

.task-modal-content {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 26px;
    padding: 34px;
    max-width: 500px;
    width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    backdrop-filter: blur(20px);
}

.task-modal-content h3 {
    color: #ffffff;
    margin-bottom: 22px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: #ffffff;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 13px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 14px;
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: rgba(108, 92, 231, 0.8);
    box-shadow: 0 0 10px rgba(108, 92, 231, 0.3);
}

.form-group option {
    background: #1c003b;
    color: #ffffff;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 25px;
}

.form-actions button {
    padding: 12px 26px;
    border: none;
    border-radius: 14px;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

#cancel-task {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#cancel-task:hover {
    background: rgba(255, 255, 255, 0.2);
}

#save-task {
    background: #6c5ce7;
    color: #ffffff;
}

#save-task:hover {
    background: #5b4bd5;
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════
   PLANNING TDAH — Nouveaux éléments
   ═══════════════════════════════════════════ */

.planning-outer {
    max-width: 1400px;
    margin: 0 auto;
}

/* Bannière conseil TDAH */
.tdah-tip-banner {
    display: flex;
    align-items: center;
    gap: 20px;
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(162, 155, 254, 0.1));
    border: 1px solid rgba(108, 92, 231, 0.4);
    border-radius: 18px;
    padding: 22px 28px;
    margin-bottom: 36px;
    transition: opacity 0.2s ease;
}

.tdah-tip-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.tdah-tip-text {
    flex: 1;
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    line-height: 1.55;
}

.tdah-tip-next {
    background: rgba(108, 92, 231, 0.3);
    border: 1px solid rgba(108, 92, 231, 0.5);
    color: #ffffff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tdah-tip-next:hover {
    background: rgba(108, 92, 231, 0.6);
    transform: scale(1.1);
}

/* Rappel TDAH dans les tâches */
.tdah-reminder {
    background: rgba(253, 203, 110, 0.1);
    border: 1px solid rgba(253, 203, 110, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 22px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

/* Sous-titre de section */
.section-subtitle {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    text-align: center;
    margin-bottom: 28px;
    margin-top: -12px;
}

/* ═══════════════════════════════════
   SECTION POMODORO
   ═══════════════════════════════════ */
.pomodoro-section {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 22px;
    padding: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.pomodoro-section h2 {
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 1.5rem;
    text-align: center;
}

.pomodoro-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
    padding: 18px 0 8px;
}

.pomodoro-mode-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.mode-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.work-dot {
    background: #e17055;
    box-shadow: 0 0 10px rgba(225, 112, 85, 0.6);
}

.break-dot {
    background: #00cec9;
    box-shadow: 0 0 10px rgba(0, 206, 201, 0.6);
}

.pomodoro-circle {
    position: relative;
    width: 180px;
    height: 180px;
}

.pomodoro-svg {
    width: 180px;
    height: 180px;
    transform: rotate(-90deg);
}

.pomodoro-track {
    fill: none;
    stroke: rgba(255, 255, 255, 0.1);
    stroke-width: 8;
}

.pomodoro-progress {
    fill: none;
    stroke: #e17055;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 339.3;
    stroke-dashoffset: 339.3;
    transition: stroke-dashoffset 1s linear, stroke 0.5s ease;
}

.pomodoro-time-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

#pomodoro-time {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
}

.pomodoro-sessions {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
}

.pomodoro-controls {
    display: flex;
    gap: 12px;
}

.pomo-btn {
    padding: 12px 28px;
    border-radius: 30px;
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.pomo-start {
    background: linear-gradient(135deg, #e17055, #d63031);
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(225, 112, 85, 0.4);
}

.pomo-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(225, 112, 85, 0.5);
}

.pomo-reset {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pomo-reset:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pomodoro-tip {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.55);
    text-align: center;
    max-width: 320px;
    line-height: 1.5;
    font-style: italic;
}

/* Responsive pour le planning */
@media (max-width: 1024px) {
    .planning-container {
        grid-template-columns: 1fr;
        gap: 28px;
    }

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

@media (max-width: 768px) {
    .planning-container {
        padding: 8px 0 24px;
        gap: 22px;
    }

    .schedule-section,
    .daily-tasks-section,
    .stats-section {
        padding: 24px;
    }

    .tasks-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .schedule-item {
        padding: 14px 16px;
    }

    .schedule-time {
        min-width: 100px;
        font-size: 0.8rem;
    }

    .task-modal-content {
        padding: 24px;
        margin: 20px;
    }
}
/* ─── Onboarding modal ──────────────────────────────────────────────── */
#onboarding-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

#onboarding-modal.hidden {
    display: none;
}

.onboarding-content {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 44px 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.onboarding-content h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 10px;
}

.onboarding-content p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 28px;
    font-size: 1.05rem;
}

#onboarding-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

#user-name-input {
    padding: 14px 18px;
    border-radius: 16px;
    font-family: inherit;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 1rem;
    outline: none;
    text-align: center;
}

#user-name-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#user-name-input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.15);
}

.onboarding-btn {
    padding: 14px;
    border-radius: 16px;
    font-family: inherit;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.onboarding-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ─── Bouton "Marquer comme fait" (exercices) ───────────────────────── */
.mark-exercise-done-btn {
    display: block;
    margin: 24px auto 0;
    padding: 12px 28px;
    border-radius: 30px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.mark-exercise-done-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.03);
}

/* ─── Note sur les tâches ───────────────────────────────────────────── */
.task-note {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.55);
    font-style: italic;
    margin-top: 2px;
    flex-basis: 100%;
}

/* ─── Message "aucune tâche" ────────────────────────────────────────── */
.no-tasks {
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 30px;
    font-style: italic;
}

/* ─── Sagesse : sage-cards ──────────────────────────────────────── */

.sagesse-article {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sage-intro {
    padding: 0.25rem 0 0.5rem;
    opacity: 0.8;
    font-size: 1rem;
    line-height: 1.7;
}

.sage-intro p { margin-bottom: 0.6rem; }

/* Carte de section */
.sage-card {
    border-radius: 14px;
    border-left: 4px solid;
    background: rgba(255, 255, 255, 0.04);
    overflow: hidden;
}

/* Accents */
.sage-accent-gold    { border-color: #fbbf24; }
.sage-accent-emerald { border-color: #34d399; }
.sage-accent-rose    { border-color: #fb7185; }
.sage-accent-sky     { border-color: #60a5fa; }
.sage-accent-violet  { border-color: #a78bfa; }
.sage-accent-amber   { border-color: #f59e0b; }
.sage-accent-teal    { border-color: #2dd4bf; }

.sage-accent-gold    .sage-card-header { background: rgba(251, 191,  36, 0.12); }
.sage-accent-emerald .sage-card-header { background: rgba( 52, 211, 153, 0.12); }
.sage-accent-rose    .sage-card-header { background: rgba(251, 113, 133, 0.12); }
.sage-accent-sky     .sage-card-header { background: rgba( 96, 165, 250, 0.12); }
.sage-accent-violet  .sage-card-header { background: rgba(167, 139, 250, 0.12); }
.sage-accent-amber   .sage-card-header { background: rgba(245, 158,  11, 0.12); }
.sage-accent-teal    .sage-card-header { background: rgba( 45, 212, 191, 0.12); }

.sage-accent-gold    .sage-card-title { color: #fbbf24; }
.sage-accent-emerald .sage-card-title { color: #34d399; }
.sage-accent-rose    .sage-card-title { color: #fb7185; }
.sage-accent-sky     .sage-card-title { color: #60a5fa; }
.sage-accent-violet  .sage-card-title { color: #a78bfa; }
.sage-accent-amber   .sage-card-title { color: #f59e0b; }
.sage-accent-teal    .sage-card-title { color: #2dd4bf; }

/* En-tête de carte */
.sage-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sage-card-emoji {
    font-size: 1.7rem;
    flex-shrink: 0;
    line-height: 1;
}

.sage-card-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

/* Corps de carte */
.sage-card-body {
    padding: 20px 22px 22px;
}

.sage-card-body h1 { display: none; }

.sage-card-body h3 {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    margin: 1.1em 0 0.4em;
}

.sage-card-body p {
    margin-bottom: 0.75em;
    line-height: 1.75;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
}

.sage-card-body ul,
.sage-card-body ol {
    padding-left: 1.3rem;
    margin: 0.4em 0 0.75em;
    color: rgba(255, 255, 255, 0.82);
}

.sage-card-body li { margin-bottom: 0.3em; line-height: 1.6; }

.sage-card-body strong { color: rgba(255, 255, 255, 0.95); }

.sage-card-body em { color: rgba(255, 255, 255, 0.75); }

.sage-card-body blockquote {
    border-left: 3px solid rgba(255, 255, 255, 0.25);
    padding: 8px 14px;
    margin: 0.8em 0;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: rgba(255, 255, 255, 0.72);
}

.sage-card-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.8em 0;
    font-size: 0.88rem;
}

.sage-card-body th {
    padding: 7px 11px;
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sage-card-body td {
    padding: 7px 11px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.78);
}

.sage-card-body code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Masquer les blocs de code ASCII et les séparateurs --- */
.sage-card-body pre { display: none; }
.sage-card-body hr  { display: none; }

/* ─── Diagramme Ikigai ──────────────────────────────────────────── */

.ikigai-diagram {
    position: relative;
    width: 280px;
    height: 280px;
    margin: 1rem auto 0;
    flex-shrink: 0;
}

.ik-circle {
    position: absolute;
    width: 158px;
    height: 158px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 0.7rem;
    line-height: 1.4;
    padding: 14px;
    color: rgba(255, 255, 255, 0.92);
    mix-blend-mode: screen;
}

.ik-love {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(244, 114, 182, 0.52);
}

.ik-good {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    background: rgba(96, 165, 250, 0.52);
}

.ik-need {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(52, 211, 153, 0.52);
}

.ik-paid {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    background: rgba(251, 191, 36, 0.52);
}

.ik-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 10px rgba(255,255,255,0.8), 0 0 20px rgba(255,255,255,0.4);
    text-align: center;
    z-index: 2;
    letter-spacing: 0.08em;
    line-height: 1.5;
    pointer-events: none;
}

@media (max-width: 480px) {
    .ikigai-diagram {
        width: 240px;
        height: 240px;
    }
    .ik-circle {
        width: 136px;
        height: 136px;
        font-size: 0.62rem;
        padding: 10px;
    }
}

/* ═══════════════════════════════════════════════════════════
   NAVIGATION UNIFIÉE (_nav.php)
   ═══════════════════════════════════════════════════════════ */

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    text-align: left;
    padding: 20px 32px;
    margin-bottom: 28px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    flex-shrink: 0;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    letter-spacing: 0.04em;
}

.site-logo:hover {
    color: #a29bfe;
}

.header-user {
    flex-shrink: 0;
}

.user-greeting {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.55);
}

/* Overrides pour sagesse (search dans le header) */
.header .search-container {
    margin: 0;
    flex: 1;
    min-width: 180px;
    max-width: 320px;
}

/* ═══════════════════════════════════════════════════════════
   ONGLETS DE PLANNING
   ═══════════════════════════════════════════════════════════ */

.planning-tabs {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 6px;
    margin-bottom: 36px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: fit-content;
}

.planning-tab {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.55);
    padding: 11px 24px;
    border-radius: 10px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    white-space: nowrap;
}

.planning-tab:hover {
    color: rgba(255, 255, 255, 0.85);
    background: rgba(255, 255, 255, 0.07);
}

.planning-tab.active {
    background: rgba(108, 92, 231, 0.35);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(108, 92, 231, 0.25);
}

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

.planning-tab-content.hidden {
    display: none;
}

/* Variante compacte de la bannière TDAH */
.tdah-tip-compact {
    padding: 10px 16px;
    margin-bottom: 16px;
    gap: 10px;
}

.tdah-tip-compact .tdah-tip-icon {
    font-size: 1.2rem;
}

.tdah-tip-compact .tdah-tip-text {
    font-size: 0.82rem;
    opacity: 0.85;
}

/* ═══════════════════════════════════════════════════════════
   TIROIR OUTILS
   ═══════════════════════════════════════════════════════════ */

/* ─── Bouton "✦ Outils" pill frosted-glass ─── */
.tools-toggle-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 10px 22px;
    border-radius: 999px;
    background: rgba(108, 92, 231, 0.55);
    border: 1px solid rgba(179, 157, 255, 0.45);
    color: #e8e0ff;
    font-size: 0.92rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    z-index: 500;
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.45), 0 0 0 1px rgba(255,255,255,0.06);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.tools-toggle-btn:hover {
    transform: translateY(-2px);
    background: rgba(108, 92, 231, 0.82);
    box-shadow: 0 8px 30px rgba(108, 92, 231, 0.6), 0 0 0 1px rgba(255,255,255,0.1);
}

.tools-drawer {
    position: fixed;
    bottom: 90px;
    right: 28px;
    width: 380px;
    max-width: calc(100vw - 40px);
    max-height: 70vh;
    background: rgba(20, 14, 40, 0.96);
    border: 1px solid rgba(108, 92, 231, 0.35);
    border-radius: 18px;
    z-index: 499;
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tools-drawer.hidden {
    display: none;
}

.tools-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tools-drawer-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
}

.tools-drawer-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 6px;
    transition: all 0.15s;
}

.tools-drawer-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tools-drawer-body {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}

.tool-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tool-section:last-child {
    border-bottom: none;
}

.tool-section-title {
    padding: 12px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background 0.15s;
}

.tool-section-title::-webkit-details-marker { display: none; }

.tool-section-title::after {
    content: '›';
    margin-left: auto;
    transition: transform 0.2s;
    opacity: 0.5;
}

details[open] .tool-section-title::after {
    transform: rotate(90deg);
}

.tool-section-title:hover {
    background: rgba(255, 255, 255, 0.04);
}

.tool-section > div {
    padding: 4px 14px 14px;
}

/* ═══════════════════════════════════════════════════════════
   VUE SEMAINE
   ═══════════════════════════════════════════════════════════ */

.week-section h2 {
    color: #fff;
    margin-bottom: 20px;
    font-size: 1.4rem;
    text-align: center;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.week-day-col {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    padding: 18px 14px;
    min-width: 110px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.week-day-today {
    border-color: rgba(108, 92, 231, 0.55);
    background: rgba(108, 92, 231, 0.1);
}

.week-day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.week-day-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
}

.week-task-count {
    font-size: 0.7rem;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 1px 7px;
    color: rgba(255, 255, 255, 0.6);
}

.week-task-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
}

.week-task-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
}

.week-task-item.priority-high { border-left: 2px solid #e17055; }
.week-task-item.priority-medium { border-left: 2px solid #fdcb6e; }
.week-task-item.priority-low { border-left: 2px solid #55efc4; }

.week-task-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.week-task-edit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.7rem;
    opacity: 0;
    transition: opacity 0.15s;
    padding: 0 2px;
}

.week-task-item:hover .week-task-edit {
    opacity: 0.7;
}

.week-no-tasks {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.75rem;
    text-align: center;
    padding: 4px 0;
}

.week-add-task {
    background: rgba(108, 92, 231, 0.2);
    border: 1px dashed rgba(108, 92, 231, 0.4);
    color: rgba(255, 255, 255, 0.55);
    border-radius: 8px;
    padding: 5px;
    font-size: 0.75rem;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.week-add-task:hover {
    background: rgba(108, 92, 231, 0.35);
    color: #fff;
}

@media (max-width: 900px) {
    .week-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .week-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ═══════════════════════════════════════════════════════════
   PLANIFICATEUR DE REPAS
   ═══════════════════════════════════════════════════════════ */

/* ─── Meals compact redesign ─── */

.meals-week-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.45);
}

.meals-gen-btn {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(108, 92, 231, 0.45);
    border: 1px solid rgba(179, 157, 255, 0.3);
    color: #e8e0ff;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.meals-gen-btn:hover {
    background: rgba(108, 92, 231, 0.75);
}

.meals-day-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.meal-day-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.meal-day-header {
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.meal-slots {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meal-slot {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meal-slot-icon {
    font-size: 0.85rem;
    flex-shrink: 0;
    width: 18px;
    text-align: center;
}

.meal-slot-input {
    flex: 1;
    min-width: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.78rem;
    padding: 4px 7px;
    height: 28px;
    transition: border-color 0.15s, background 0.15s;
}

.meal-slot-input:focus {
    outline: none;
    border-color: rgba(108, 92, 231, 0.5);
    background: rgba(108, 92, 231, 0.08);
}

.meal-slot-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

.meal-to-cart-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 2px 3px;
    border-radius: 4px;
    opacity: 0.6;
    transition: opacity 0.15s, background 0.15s;
    line-height: 1;
}

.meal-to-cart-btn:hover:not(:disabled) {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
}

.meal-to-cart-btn:disabled {
    opacity: 0.2;
    cursor: default;
}

/* Modal génération courses depuis repas */
.meals-gen-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.meals-gen-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    cursor: pointer;
}

.meals-gen-item:hover {
    background: rgba(255, 255, 255, 0.07);
}

.meals-gen-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    flex-shrink: 0;
}

.meals-gen-dish {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.88);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .meals-day-grid {
        grid-template-columns: 1fr;
    }
}

/* ═══════════════════════════════════════════════════════════
   LISTE DE COURSES
   ═══════════════════════════════════════════════════════════ */

.shopping-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.shopping-progress {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

.shopping-clear-btn {
    background: rgba(255, 118, 117, 0.2);
    border: 1px solid rgba(255, 118, 117, 0.35);
    color: rgba(255, 118, 117, 0.9);
    border-radius: 8px;
    padding: 4px 10px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
}

.shopping-clear-btn:hover {
    background: rgba(255, 118, 117, 0.35);
}

.shopping-add-form {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

#shopping-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #fff;
    padding: 7px 11px;
    font-size: 0.83rem;
    min-width: 0;
}

#shopping-input:focus {
    outline: none;
    border-color: rgba(108, 92, 231, 0.5);
}

#shopping-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

#shopping-cat-select {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    padding: 6px 8px;
    font-size: 0.78rem;
    cursor: pointer;
    max-width: 110px;
}

.shopping-add-form button[type="submit"] {
    background: rgba(108, 92, 231, 0.55);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.shopping-add-form button[type="submit"]:hover {
    background: rgba(108, 92, 231, 0.85);
}

.shopping-group {
    margin-bottom: 10px;
}

.shopping-cat {
    font-size: 0.74rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 5px;
    padding-left: 4px;
}

.shopping-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.shopping-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    font-size: 0.84rem;
    transition: background 0.15s;
}

.shopping-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

.shopping-checked .shopping-label span {
    text-decoration: line-through;
    opacity: 0.4;
}

.shopping-label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.85);
}

.shopping-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    cursor: pointer;
    flex-shrink: 0;
}

.shopping-delete {
    background: none;
    border: none;
    color: rgba(255, 118, 117, 0.5);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0 2px;
    opacity: 0;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.shopping-item:hover .shopping-delete {
    opacity: 1;
}

.shopping-empty {
    font-size: 0.83rem;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
    padding: 16px 0;
}

/* ═══════════════════════════════════════════════════════════
   SAGESSE — SECTIONS PAR DOSSIER
   ═══════════════════════════════════════════════════════════ */

.sagesse-folder-section {
    margin-bottom: 36px;
}

.sagesse-folder-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 14px;
    padding-left: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sagesse-folder-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

/* ═══════════════════════════════════════════════════════════
   SAGESSE — VUE ARBORESCENTE
   ═══════════════════════════════════════════════════════════ */

.sagesse-root-grid {
    margin-bottom: 24px;
}

.sagesse-tree-folder {
    margin-bottom: 14px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sagesse-tree-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px 24px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.04);
    transition: background 0.2s ease;
    user-select: none;
}

.sagesse-tree-header:hover {
    background: rgba(255, 255, 255, 0.08);
}

.sagesse-tree-header.open {
    background: rgba(108, 92, 231, 0.12);
    border-bottom: 1px solid rgba(108, 92, 231, 0.2);
}

.tree-arrow {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
    transition: transform 0.2s ease;
    width: 14px;
    text-align: center;
    flex-shrink: 0;
}

.sagesse-tree-header.open .tree-arrow {
    color: rgba(108, 92, 231, 0.9);
}

.tree-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.tree-label {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    text-transform: capitalize;
}

.tree-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 2px 10px;
    flex-shrink: 0;
}

.sagesse-tree-content {
    padding: 22px 20px 14px;
    background: rgba(0, 0, 0, 0.15);
}

.sagesse-tree-content.hidden {
    display: none;
}

.sagesse-subfolder-grid {
    animation: fadeInUp 0.25s ease;
}

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

@media (max-width: 768px) {
    .tools-drawer {
        width: calc(100vw - 20px);
        right: 10px;
        bottom: 80px;
    }

    .tools-toggle-btn {
        bottom: 16px;
        right: 16px;
    }

    .planning-tabs {
        width: 100%;
        justify-content: center;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .planning-tab {
        flex: 1;
        text-align: center;
        padding: 10px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

/* ═══════════════════════════════════════════════════════════
   BOUTON NOUVELLE SEMAINE
   ═══════════════════════════════════════════════════════════ */

.new-week-bar {
    display: flex;
    justify-content: flex-end;
    margin: 6px 0 14px;
}

.new-week-btn {
    padding: 8px 20px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.84rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.15s ease;
    backdrop-filter: blur(8px);
}

.new-week-btn:hover {
    background: rgba(108, 92, 231, 0.35);
    transform: translateY(-1px);
    border-color: rgba(179, 157, 255, 0.4);
    color: #fff;
}

/* ═══════════════════════════════════════════════════════════
   MODAL TEMPLATES
   ═══════════════════════════════════════════════════════════ */

.template-modal-content {
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
}

.template-modal-subtitle {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.88rem;
    margin: -8px 0 20px;
}

.template-section {
    margin-bottom: 24px;
}

.template-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 10px;
}

.templates-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.template-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: background 0.15s ease;
}

.template-card:hover {
    background: rgba(255, 255, 255, 0.09);
}

.template-card-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 36px;
    text-align: center;
}

.template-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.template-card-name {
    color: #fff;
    font-size: 0.95rem;
}

.template-card-desc {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
}

.template-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.template-apply-btn {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(108, 92, 231, 0.55);
    border: 1px solid rgba(179, 157, 255, 0.35);
    color: #e8e0ff;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.template-apply-btn:hover {
    background: rgba(108, 92, 231, 0.9);
}

.template-delete-btn {
    padding: 5px 8px;
    border-radius: 8px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 100, 100, 0.7);
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.15s ease;
}

.template-delete-btn:hover {
    background: rgba(255, 80, 80, 0.15);
}

.template-save-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.template-save-form input[type="text"] {
    flex: 1;
    padding: 9px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 0.88rem;
}

.template-save-form input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.btn-save-template {
    padding: 9px 18px;
    border-radius: 10px;
    background: rgba(108, 92, 231, 0.55);
    border: 1px solid rgba(179, 157, 255, 0.35);
    color: #e8e0ff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    white-space: nowrap;
}

.btn-save-template:hover {
    background: rgba(108, 92, 231, 0.85);
}
