/**
 * ============================================================
 * NeuroTodo - Styles CSS v5.5 - Style TicketLu
 * Layout moderne avec sidebar fixe à gauche
 * + Mode sombre
 * + Intégration Google Calendar
 * + Page Suggestions IA dédiée
 * Deployed: 2026-02-03
 * ============================================================
 */

/* ============================================================
   RESET & BASE
   ============================================================ */

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

:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;

    --success: #22C55E;
    --warning: #F59E0B;
    --error: #EF4444;

    --bg-dark: #1a1a2e;
    --bg-light: #F8FAFC;
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;

    --text-dark: #1E293B;
    --text-gray: #64748B;
    --text-light: #94A3B8;
    --text-white: #F1F5F9;

    --border: #E2E8F0;

    --sidebar-width: 240px;
    --header-height: 60px;

    --radius: 12px;
    --radius-sm: 8px;

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   MODE SOMBRE
   ============================================================ */

[data-theme="dark"] {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;

    --success: #34D399;
    --warning: #FBBF24;
    --error: #F87171;

    --bg-dark: #1a1a2e;
    --bg-light: #16213e;
    --bg-white: rgba(37, 37, 66, 0.95);
    --bg-card: rgba(37, 37, 66, 0.95);

    --text-dark: #F1F5F9;
    --text-gray: #94A3B8;
    --text-light: #64748B;
    --text-white: #F8FAFC;

    --border: rgba(255, 255, 255, 0.1);

    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
    border-right-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .sidebar .logo {
    color: #60a5fa;
}

[data-theme="dark"] .sidebar .nav-btn {
    color: #94A3B8;
}

[data-theme="dark"] .sidebar .nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

[data-theme="dark"] .sidebar .nav-btn.active {
    background: #3b82f6;
    color: white;
}

[data-theme="dark"] .sidebar-header,
[data-theme="dark"] .sidebar-streak,
[data-theme="dark"] .sidebar-user,
[data-theme="dark"] .sidebar-xp {
    border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .user-name {
    color: #F1F5F9;
}

[data-theme="dark"] .user-email,
[data-theme="dark"] .streak-label,
[data-theme="dark"] .xp-level,
[data-theme="dark"] .xp-text {
    color: #94A3B8;
}

[data-theme="dark"] .xp-progress {
    background: rgba(255, 255, 255, 0.15);
}

[data-theme="dark"] .streak-freeze {
    background: rgba(147, 197, 253, 0.2);
    color: #93C5FD;
}

[data-theme="dark"] .main-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

[data-theme="dark"] .suggestion-card,
[data-theme="dark"] .task-card,
[data-theme="dark"] .stat-card,
[data-theme="dark"] .settings-section,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .calendar-preview,
[data-theme="dark"] .suggestions-teaser {
    background: var(--bg-card);
    border-color: var(--border);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: var(--bg-white);
    border-color: var(--border);
    color: var(--text-dark);
}

[data-theme="dark"] .btn-secondary {
    background: var(--bg-white);
    color: var(--text-dark);
}

[data-theme="dark"] .filter-btn {
    background: var(--bg-white);
    color: var(--text-gray);
}

[data-theme="dark"] .filter-btn.active {
    background: var(--primary);
    color: white;
}

[data-theme="dark"] .today-event {
    background: var(--bg-white);
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.5;
}

/* ============================================================
   LAYOUT PRINCIPAL
   ============================================================ */

#app {
    display: flex;
    min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: #FFFFFF;
    border-right: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 16px 16px;
    border-bottom: 1px solid #E2E8F0;
}

.logo {
    color: #3b82f6;
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    overflow-y: auto;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: #64748B;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
}

.nav-btn:hover {
    background: #EFF6FF;
    color: #3b82f6;
}

.nav-btn.active {
    background: #DBEAFE;
    color: #3b82f6;
}

.nav-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.nav-label {
    font-size: 0.85rem;
}

.sidebar-streak {
    padding: 12px;
    border-top: 1px solid #E2E8F0;
    text-align: center;
}

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #FEF3C7, #FDE68A);
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 700;
    color: #D97706;
    font-size: 0.85rem;
}

.streak-label {
    color: #64748B;
    font-size: 0.7rem;
    margin-top: 4px;
}

.streak-freeze {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 4px 10px;
    background: #DBEAFE;
    border-radius: 12px;
    font-size: 0.7rem;
    color: #3b82f6;
}

.streak-freeze.used {
    opacity: 0.4;
    text-decoration: line-through;
}

.freeze-icon {
    font-size: 0.85rem;
}

/* Menu utilisateur */
.sidebar-user {
    padding: 12px;
    border-top: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #1E293B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.7rem;
    color: #64748B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-btn {
    background: rgba(255, 107, 107, 0.15);
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.logout-btn:hover {
    background: rgba(255, 107, 107, 0.3);
    transform: scale(1.05);
}

/* XP / Niveau Widget */
.sidebar-xp {
    padding: 8px 12px;
    border-top: 1px solid #E2E8F0;
    text-align: center;
    order: -1; /* Apparaît avant le streak */
}

.xp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #93c5fd, #60a5fa);
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 700;
    color: #5B21B6;
    font-size: 0.85rem;
}

.xp-level {
    color: #64748B;
    font-size: 0.7rem;
    margin-top: 4px;
    font-weight: 500;
}

.xp-progress {
    width: 100%;
    height: 6px;
    background: #E2E8F0;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.xp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #8B5CF6);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.xp-text {
    color: #64748B;
    font-size: 0.65rem;
    margin-top: 4px;
    opacity: 0.8;
}

/* Animation gain XP */
.xp-gain-popup {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: linear-gradient(135deg, #7C3AED, #6D28D9);
    color: white;
    padding: 10px 20px;
    border-radius: var(--radius);
    font-weight: 700;
    z-index: 9999;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 20px rgba(0, 212, 170, 0.4);
}

.xp-gain-popup.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.xp-gain-popup .xp-amount {
    font-size: 1.2rem;
}

.xp-gain-popup .xp-reason {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 500;
}

/* Animation Level Up */
.level-up-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-up-overlay.show {
    opacity: 1;
}

.level-up-content {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    padding: 3rem;
    border-radius: var(--radius-lg);
    text-align: center;
    animation: levelUpBounce 0.5s ease;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 60px rgba(0, 212, 170, 0.5);
}

@keyframes levelUpBounce {
    0% { transform: scale(0.5); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.level-up-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: levelUpPulse 1s ease infinite;
}

@keyframes levelUpPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.level-up-title {
    font-size: 2rem;
    font-weight: 800;
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
    margin-bottom: 0.5rem;
}

.level-up-name {
    font-size: 1.2rem;
    color: #a78bfa;
    margin-bottom: 1.5rem;
}

/* Bouton Zeigarnik */
.btn-zeigarnik {
    background: linear-gradient(135deg, #8B5CF6, #7C3AED) !important;
    color: white !important;
    border: none !important;
    animation: zeigarnikPulse 2s ease-in-out infinite;
}

@keyframes zeigarnikPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 170, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(0, 212, 170, 0); }
}

/* Timer Zeigarnik Overlay */
.zeigarnik-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.zeigarnik-overlay.show {
    opacity: 1;
}

.zeigarnik-content {
    background: linear-gradient(135deg, #1e1b4b, #312e81);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 2px solid #3b82f6;
    box-shadow: 0 0 60px rgba(0, 212, 170, 0.3);
}

.zeigarnik-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.zeigarnik-badge {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-close-zeigarnik {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
}

.btn-close-zeigarnik:hover {
    color: white;
}

.zeigarnik-title {
    color: #e2e8f0;
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.zeigarnik-task {
    color: #a78bfa;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.zeigarnik-timer-display {
    font-size: 4rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 30px rgba(167, 139, 250, 0.5);
    margin-bottom: 1rem;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', monospace;
}

.zeigarnik-timer-display.completed {
    color: #10b981;
    animation: completedPulse 1s ease-in-out infinite;
}

@keyframes completedPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.zeigarnik-tip {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.zeigarnik-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Alerte Chunking (tâche > 45min) */
.chunking-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 12px;
    animation: chunkingSlide 0.3s ease;
}

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

.chunking-alert.hidden {
    display: none;
}

.chunking-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.chunking-text strong {
    color: #b45309;
    display: block;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

.chunking-text p {
    color: #92400e;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* Peak-End Suggestion (fin de journée) */
.peak-end-suggestion {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #ecfdf5, #d1fae5);
    border: 1px solid #10b981;
    border-radius: var(--radius);
    padding: 16px 20px;
    max-width: 320px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    animation: peakEndSlide 0.3s ease;
}

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

.peak-end-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.peak-end-badge {
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.peak-end-close {
    background: transparent;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.2rem;
}

.peak-end-title {
    font-weight: 600;
    color: #065f46;
    margin-bottom: 4px;
}

.peak-end-task {
    color: #047857;
    font-size: 0.9rem;
    margin-bottom: 12px;
}

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

.peak-end-actions .btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.85rem;
}

/* ============================================================
   WOOP - Wish, Outcome, Obstacle, Plan
   ============================================================ */

.btn-woop {
    background: linear-gradient(135deg, #06b6d4, #0891b2) !important;
    color: white !important;
}

.woop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.woop-overlay.show {
    opacity: 1;
}

.woop-content {
    background: linear-gradient(135deg, #0f172a, #1e3a5f);
    padding: 2rem;
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 90%;
    border: 2px solid #06b6d4;
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.3);
}

.woop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.woop-badge {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-close-woop {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
}

.woop-task-name {
    color: #67e8f9;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.woop-intro {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.woop-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.woop-step label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #e2e8f0;
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
}

.step-letter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #06b6d4;
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
}

.woop-step input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #334155;
    border-radius: var(--radius-sm);
    background: #1e293b;
    color: white;
    font-size: 0.9rem;
}

.woop-step input:focus {
    outline: none;
    border-color: #06b6d4;
}

.woop-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: flex-end;
}

/* ============================================================
   TIME BOXING CHALLENGE
   ============================================================ */

.btn-timebox {
    background: linear-gradient(135deg, #f59e0b, #d97706) !important;
    color: white !important;
}

.timebox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.timebox-overlay.show {
    opacity: 1;
}

.timebox-content {
    background: linear-gradient(135deg, #451a03, #78350f);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 2px solid #f59e0b;
    box-shadow: 0 0 60px rgba(245, 158, 11, 0.3);
}

.timebox-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.timebox-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-close-timebox {
    background: transparent;
    border: none;
    color: #fcd34d;
    font-size: 1.2rem;
    cursor: pointer;
}

.timebox-title {
    color: #fcd34d;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.timebox-task {
    color: #fbbf24;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.timebox-timer {
    font-size: 4rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 0 30px rgba(251, 191, 36, 0.5);
    margin-bottom: 1rem;
    font-family: 'SF Mono', monospace;
    transition: color 0.3s ease;
}

.timebox-progress {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.timebox-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    transition: width 1s linear;
    width: 0%;
}

.timebox-tip {
    color: #fcd34d;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.timebox-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* ============================================================
   NOVELTY TIPS - Suggestions créatives
   ============================================================ */

.novelty-tip-popup {
    position: fixed;
    top: 80px;
    right: 20px;
    background: linear-gradient(135deg, #faf5ff, #f3e8ff);
    border: 1px solid #c084fc;
    border-radius: var(--radius);
    padding: 16px 20px;
    max-width: 320px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 4px 20px rgba(192, 132, 252, 0.3);
    z-index: 1000;
    animation: noveltySlide 0.4s ease;
}

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

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

.novelty-tip-content {
    flex: 1;
}

.novelty-tip-label {
    display: block;
    font-size: 0.75rem;
    color: #9333ea;
    font-weight: 600;
    margin-bottom: 4px;
}

.novelty-tip-text {
    color: #6b21a8;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

.novelty-tip-close {
    background: transparent;
    border: none;
    color: #a855f7;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
}

/* ============================================================
   CONTENT WRAPPER
   ============================================================ */

.content-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================================
   HEADER
   ============================================================ */

.header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 50;
}

.date {
    font-weight: 500;
    color: var(--text-gray);
}

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

/* Progress du jour */
.daily-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--bg-light);
    border-radius: 20px;
    font-size: 0.85rem;
}

.daily-progress-icon {
    font-size: 0.9rem;
}

.daily-progress-bar {
    width: 60px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.daily-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    transition: width 0.5s ease;
    width: 0%;
}

.daily-progress-text {
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.8rem;
    min-width: 30px;
}

/* IA Coach - Phrase motivante */
.ai-coach {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #f0f9ff 0%, #faf5ff 100%);
    padding: 8px 16px;
    border-radius: var(--radius);
    margin: 0 20px;
    border: 1px solid #e0e7ff;
    min-height: 42px;
    max-width: 600px;
}

.ai-coach-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.ai-coach-message {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
    font-weight: 500;
}

.ai-coach-refresh {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    opacity: 0.5;
    transition: all 0.2s;
    padding: 4px;
    border-radius: 4px;
    flex-shrink: 0;
}

.ai-coach-refresh:hover {
    opacity: 1;
    background: rgba(0, 212, 170, 0.1);
}

.ai-coach.loading .ai-coach-message {
    color: var(--text-gray);
    font-style: italic;
}

.ai-coach.loading .ai-coach-refresh {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mode sombre pour IA Coach */
[data-theme="dark"] .ai-coach {
    background: linear-gradient(135deg, #1e293b 0%, #312e81 100%);
    border-color: #4338ca;
}

[data-theme="dark"] .ai-coach-message {
    color: #e2e8f0;
}

.energy-widget {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-light);
    padding: 8px 16px;
    border-radius: 30px;
}

.energy-label {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 500;
}

.energy-slider {
    width: 120px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #EF4444, #F97316, #EAB308, #22C55E);
    border-radius: 10px;
    cursor: pointer;
}

.energy-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: white;
    border: 3px solid var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.energy-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--success);
    min-width: 35px;
    text-align: center;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */

.main {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* AI Coach Card - Phrase motivante contextuelle */
.ai-coach-card {
    background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
    padding: 16px 20px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 24px;
    position: relative;
    border: 1px solid rgba(59, 130, 246, 0.15);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
    transition: all 0.3s ease;
}

.ai-coach-card:hover {
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.12);
}

.ai-coach-card.loading {
    opacity: 0.7;
}

.ai-coach-card.loading .ai-coach-message {
    animation: aiPulse 1.5s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.ai-coach-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    filter: grayscale(20%);
}

.ai-coach-message {
    flex: 1;
    color: #1E40AF;
    font-size: 0.95rem;
    line-height: 1.5;
    font-weight: 500;
    margin: 0;
}

.ai-coach-refresh {
    background: rgba(59, 130, 246, 0.1);
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    color: #3B82F6;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ai-coach-refresh:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: rotate(180deg);
}

.ai-coach-refresh svg {
    display: block;
}

/* Dark mode pour AI Coach */
[data-theme="dark"] .ai-coach-card {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
    border-color: rgba(59, 130, 246, 0.25);
}

[data-theme="dark"] .ai-coach-message {
    color: #93C5FD;
}

[data-theme="dark"] .ai-coach-refresh {
    background: rgba(59, 130, 246, 0.2);
    color: #93C5FD;
}

[data-theme="dark"] .ai-coach-refresh:hover {
    background: rgba(59, 130, 246, 0.3);
}

/* Ancien style (compatibilité) */
.energy-advice {
    display: none;
}

/* ============================================================
   VIEWS
   ============================================================ */

.view {
    display: none;
}

.view.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-dark);
}

/* ============================================================
   SUGGESTIONS CARDS
   ============================================================ */

.suggestions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.suggestion-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.suggestion-card.impact { border-left-color: #10B981; }
.suggestion-card.urgence { border-left-color: #F59E0B; }
.suggestion-card.facilite { border-left-color: #3B82F6; }

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

.suggestion-position {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
}

.suggestion-position.impact { background: #D1FAE5; color: #065F46; }
.suggestion-position.urgence { background: #FEF3C7; color: #92400E; }
.suggestion-position.facilite { background: #DBEAFE; color: #1E40AF; }

.suggestion-slot {
    font-size: 0.8rem;
    color: var(--text-light);
}

.suggestion-name {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.suggestion-justification {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 16px;
}

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

/* ============================================================
   BUTTONS
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

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

.btn-success {
    background: var(--success);
    color: white;
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 1.3rem;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow);
}

.btn-icon:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.quick-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

/* ============================================================
   TASKS
   ============================================================ */

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

/* Ligne filtres + tri */
.filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Boutons de tri */
.sort-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.sort-btn {
    padding: 6px 14px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sort-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
}

.sort-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.sort-arrow {
    font-weight: bold;
    margin-left: 2px;
}

/* Filtre par catégorie */
.category-filter-select {
    padding: 6px 12px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--text-primary);
    min-width: 160px;
}

.category-filter-select:hover {
    border-color: var(--primary);
}

.category-filter-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

/* Anciens styles - gardés pour compatibilité */
.sort-btn.asc::after {
    content: '↑';
    margin-left: 4px;
}

.sort-btn.desc::after {
    content: '↓';
    margin-left: 4px;
}

.tasks-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* Quand la vue projet est affichée, désactiver la grille */
.tasks-list:has(.project-view) {
    display: block !important;
}

.task-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-white);
    padding: 14px 16px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border-left: 4px solid #e2e8f0;
}

.task-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-1px);
    border-left-color: var(--primary);
}

/* Zone de complétion - checkbox intégrée */
.task-complete-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.task-complete-zone:hover {
    background: rgba(0, 212, 170, 0.1);
}

.task-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: transparent;
    transition: all 0.2s ease;
}

.task-complete-zone:hover .task-check {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

.task-check.checked {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #3b82f6;
    color: white;
}

/* Ancien style - gardé pour compatibilité */
.task-complete-btn {
    display: none;
}

.task-card.completed {
    opacity: 0.6;
}

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

/* ============================================================
   SOUS-TÂCHES & PROJETS
   ============================================================ */

/* Conteneur des sous-tâches */
.subtasks-container {
    margin-left: 24px;
    padding-left: 16px;
    border-left: 2px solid var(--primary);
    margin-top: -6px;
    padding-top: 6px;
    background: linear-gradient(90deg, var(--primary-light) 0%, transparent 30%);
    border-radius: 0 0 8px 8px;
}

.subtasks-container.hidden {
    display: none;
}

/* Carte de sous-tâche (niveau 2) */
.task-card.subtask {
    background: var(--bg-white);
    padding: 12px 14px;
    margin-bottom: 6px;
    border-left: 2px solid var(--border);
}

.task-card.subtask:hover {
    border-left-color: var(--primary);
}

.task-card.subtask .task-score {
    font-size: 0.85rem;
}

/* Container des tâches niveau 1 dans un projet */
.project-tasks-container {
    margin-left: 20px;
    border-left: 3px solid #3b82f640;
    padding-left: 12px;
}

.project-tasks-container .task-card {
    margin-bottom: 8px;
}

/* Sous-tâches niveau 2 (dans une tâche niveau 1) */
.level2-subtasks {
    margin-left: 24px;
    border-left: 2px dashed var(--border);
    padding-left: 10px;
}

/* Actions sur les cartes de tâches */
.task-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 4px;
    flex-shrink: 0;
    margin-left: auto;
    padding-left: 12px;
}

.task-actions .task-score {
    font-size: 0.8rem;
    font-weight: 700;
    color: #b45309;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
}

.task-actions .task-score::before {
    display: none;
}

/* Bouton supprimer sur carte */
.btn-delete-task {
    background: none;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 0.85rem;
    opacity: 0.3;
    transition: all 0.2s;
    border-radius: 4px;
}

.task-card:hover .btn-delete-task {
    opacity: 0.6;
}

.btn-delete-task:hover {
    opacity: 1;
    background: #FEE2E2;
}

/* Bouton toggle sous-tâches */
.btn-toggle-subtasks {
    background: var(--primary-light);
    border: 1px solid var(--primary);
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-toggle-subtasks:hover {
    background: var(--primary);
}

.btn-toggle-subtasks:hover .toggle-arrow {
    color: white;
}

.toggle-arrow {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--primary);
    transition: transform 0.2s;
}

/* Icônes projet et sous-tâche */
.project-icon {
    margin-right: 6px;
}

.subtask-icon {
    color: var(--text-light);
    margin-right: 4px;
    font-size: 0.85em;
}

/* Barre de progression projet */
.project-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg-gray);
    border-radius: 3px;
    overflow: hidden;
    max-width: 150px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--success));
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-light);
    white-space: nowrap;
}

.progress-time {
    font-size: 0.7rem;
    color: var(--text-gray);
    background: var(--bg-gray);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

/* Tâche avec sous-tâches (projet) */
.task-card.has-subtasks {
    border-left: 3px solid var(--primary);
}

/* Carte de projet (style distinct) */
.task-card.project-card {
    background: linear-gradient(135deg, #3b82f615 0%, #1d4ed815 100%);
    border: 1px solid #3b82f640;
    border-left: 4px solid #3b82f6;
}

.task-card.project-card:hover {
    background: linear-gradient(135deg, #3b82f620 0%, #1d4ed820 100%);
    border-color: #3b82f660;
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.15);
}

[data-theme="dark"] .task-card.project-card {
    background: linear-gradient(135deg, #3b82f620 0%, #1d4ed820 100%);
    border-color: #3b82f650;
}

[data-theme="dark"] .task-card.project-card:hover {
    background: linear-gradient(135deg, #3b82f630 0%, #1d4ed830 100%);
    border-color: #3b82f670;
}

.project-icon {
    font-size: 1.3rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border-radius: 8px;
    flex-shrink: 0;
}

.project-label {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    margin-right: 4px;
    vertical-align: middle;
}

/* Sous-tâches dans le modal de détail */
.subtasks-detail {
    background: var(--bg-gray);
    border-radius: var(--radius);
    padding: 16px;
    margin: 16px 0;
}

.subtasks-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.progress-bar-inline {
    flex: 1;
    height: 8px;
    background: var(--bg-white);
    border-radius: 4px;
    overflow: hidden;
    max-width: 120px;
}

.progress-percent {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
}

.subtasks-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subtask-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-white);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.subtask-item:hover {
    box-shadow: var(--shadow);
}

.subtask-item.completed {
    opacity: 0.6;
}

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

.subtask-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
    cursor: pointer;
}

.subtask-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.subtask-name {
    flex: 1;
    font-size: 0.9rem;
    cursor: pointer;
}

.subtask-name:hover {
    color: var(--primary);
}

.subtask-score {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Boutons réordonnancement sous-tâches */
.subtask-reorder {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}

.btn-reorder {
    width: 22px;
    height: 16px;
    padding: 0;
    border: 1px solid var(--border);
    background: var(--bg-white);
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.6rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text-light);
}

.btn-reorder:hover:not(:disabled) {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-reorder:disabled,
.btn-reorder.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.subtask-duration {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* Affichage durée projet avec sous-tâches */
.duration-separator {
    color: var(--text-light);
    margin: 0 4px;
}

.subtasks-duration {
    color: var(--primary);
    font-weight: 500;
}

/* Info tâche parente */
.parent-info {
    background: var(--primary-light);
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.parent-info .btn-link {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: inherit;
}

/* Info parent dans modal création sous-tâche */
.subtask-parent-info {
    background: var(--bg-gray);
    padding: 10px 14px;
    border-radius: 6px;
    margin: 0 20px 16px 20px;
    font-size: 0.9rem;
}

/* Modal sous-tâche - mise en page */
#modal-add-subtask .modal-content,
#modal-structure-project .modal-content {
    padding-bottom: 0;
}

#modal-add-subtask form,
#modal-structure-project form,
#modal-structure-project .form-group,
#modal-structure-project .structure-project-info,
#modal-structure-project .structure-results,
#modal-structure-project .form-actions {
    margin-left: 20px;
    margin-right: 20px;
}

#modal-add-subtask .form-actions,
#modal-structure-project .form-actions {
    padding: 16px 0;
    margin-bottom: 0;
    border-top: 1px solid var(--border);
    background: var(--bg-gray);
    margin-left: 0;
    margin-right: 0;
    padding-left: 20px;
    padding-right: 20px;
}

/* Bouton sous-tâche */
.btn-subtask {
    background: linear-gradient(135deg, #8B5CF6, #60a5fa);
    color: white;
}

.btn-subtask:hover {
    background: linear-gradient(135deg, #7C3AED, #8B5CF6);
}

/* Bouton IA structuration */
.btn-ai-structure {
    background: linear-gradient(135deg, #10B981, #34D399);
    color: white;
}

.btn-ai-structure:hover {
    background: linear-gradient(135deg, #059669, #10B981);
}

.btn-ai {
    background: linear-gradient(135deg, #6366F1, #818CF8);
    color: white;
}

.btn-ai:hover {
    background: linear-gradient(135deg, #4F46E5, #6366F1);
}

/* Petit bouton IA à côté d'un input */
.input-with-ai {
    display: flex;
    gap: 8px;
}

.input-with-ai input {
    flex: 1;
}

.btn-ai-sm {
    padding: 8px 12px;
    font-size: 1rem;
    background: linear-gradient(135deg, #6366F1, #818CF8);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ai-sm:hover {
    background: linear-gradient(135deg, #4F46E5, #6366F1);
    transform: scale(1.05);
}

/* Modal large pour structuration */
.modal-large {
    max-width: 700px;
}

/* Info du projet dans le modal de structuration */
.structure-project-info {
    background: linear-gradient(135deg, var(--primary-light), #E0E7FF);
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.structure-project-info h4 {
    margin: 0 0 8px 0;
    color: var(--primary);
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* Résultats de la structuration IA */
.structure-results {
    margin-top: 20px;
}

.ai-advice {
    background: #FEF3C7;
    border-left: 4px solid #F59E0B;
    padding: 12px 16px;
    border-radius: 0 6px 6px 0;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.proposed-subtasks h4 {
    margin-bottom: 12px;
    color: var(--text);
}

.proposed-subtask {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--bg-gray);
    border-radius: 6px;
    margin-bottom: 8px;
}

.subtask-check {
    padding-top: 4px;
}

.subtask-info {
    flex: 1;
}

.subtask-name-edit input {
    width: 100%;
    font-weight: 500;
    margin-bottom: 8px;
}

.subtask-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.metric-input {
    width: 45px;
    padding: 4px 6px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 4px;
}

.subtask-rationale {
    font-size: 0.8rem;
    color: var(--text-light);
    font-style: italic;
}

/* Zone de contexte élargie */
.structure-context-group textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
    font-size: 0.95rem;
}

/* Pièce jointe */
.structure-attachment-group {
    margin-top: 12px;
}

.attachment-input-wrapper {
    position: relative;
}

.structure-attachment-group input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 2px dashed var(--border);
    border-radius: 6px;
    background: var(--bg-gray);
    cursor: pointer;
}

.structure-attachment-group input[type="file"]:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.attachment-preview {
    padding: 10px 12px;
    background: #E0F2FE;
    border-radius: 6px;
    margin-top: 8px;
}

.attachment-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.attachment-file {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text);
}

.attachment-warning {
    margin-top: 8px;
    padding: 8px 10px;
    background: #FEF3C7;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #92400E;
    border-left: 3px solid #F59E0B;
}

.attachment-success {
    margin-top: 8px;
    padding: 8px 10px;
    background: #D1FAE5;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #065F46;
    border-left: 3px solid #10B981;
}

.btn-remove-attachment {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0 4px;
}

.btn-remove-attachment:hover {
    color: var(--danger);
}

.attachment-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Zone de chat interactif IA */
.ai-chat-section {
    margin-top: 20px;
    padding: 16px;
    background: linear-gradient(135deg, #F0F9FF, #E0F2FE);
    border-radius: 8px;
    border: 1px solid #BAE6FD;
}

.ai-chat-section h4 {
    margin: 0 0 12px 0;
    color: #0369A1;
    font-size: 0.95rem;
}

.ai-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.btn-chat-suggestion {
    background: white;
    border: 1px solid #7DD3FC;
    color: #0369A1;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-chat-suggestion:hover {
    background: #0EA5E9;
    color: white;
    border-color: #0EA5E9;
}

.ai-chat-input {
    display: flex;
    gap: 10px;
}

.ai-chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #7DD3FC;
    border-radius: 6px;
    font-size: 0.9rem;
}

.ai-chat-input input:focus {
    outline: none;
    border-color: #0EA5E9;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.ai-chat-input .btn {
    white-space: nowrap;
}

/* Actions finales du modal structuration */
.structure-final-actions {
    margin-top: 20px;
}

/* Justification IA dans modal sous-tâche */
.ai-rationale {
    background: #E0F2FE;
    border-left: 3px solid #0EA5E9;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    color: var(--text-gray);
    margin: 12px 0;
}

/* Temps total du projet */
.project-time-summary {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 10px;
    padding: 8px 12px;
    background: var(--bg-white);
    border-radius: 6px;
    border: 1px dashed var(--border);
}

/* Durée dans la liste des sous-tâches */
.subtask-duration {
    font-size: 0.75rem;
    color: var(--text-light);
    background: var(--bg-gray);
    padding: 2px 6px;
    border-radius: 4px;
}
}

.task-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s;
}

.task-checkbox:hover {
    border-color: var(--success);
}

.task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.task-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.task-content:hover .task-name {
    color: var(--primary);
}

.task-name {
    font-weight: 600;
    margin-bottom: 6px;
}

/* Badges Neurosciences (Eat the Frog, Quick Win) */
.neuro-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    vertical-align: middle;
    margin-right: 4px;
}

.neuro-badge.frog {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    color: #065f46;
    animation: frogPulse 2s ease-in-out infinite;
}

@keyframes frogPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.neuro-badge.quick {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #b45309;
}

/* Highlight spécial pour la grenouille */
.task-card[data-task-id]:has(.neuro-badge.frog) {
    border-left: 3px solid #10b981;
}

/* Highlight pour les quick wins */
.task-card[data-task-id]:has(.neuro-badge.quick) {
    border-left: 3px solid #f59e0b;
}

.task-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.badge {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.badge.impact { background: #DCFCE7; color: #166534; }
.badge.urgency { background: #FEF3C7; color: #92400E; }
.badge.facility { background: #DBEAFE; color: #1E40AF; }

.task-score {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* ============================================================
   LOADING
   ============================================================ */

.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    color: var(--text-light);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   MODALS
   ============================================================ */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--radius);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

/* Padding pour le contenu des modals générés dynamiquement */
.modal-content > form,
.modal-content > .task-detail,
.modal-content > p,
.modal-content > .form-group,
.modal-content > .form-row,
.modal-content > .form-actions {
    padding-left: 20px;
    padding-right: 20px;
}

.modal-content > form {
    padding-top: 16px;
    padding-bottom: 20px;
}

.modal-content > p:first-of-type {
    padding-top: 16px;
}

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

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.btn-close:hover {
    color: var(--text-dark);
}

.modal-body {
    padding: 20px;
}

/* ============================================================
   FORMS
   ============================================================ */

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

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-gray);
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Date + heure pour échéance (empilés verticalement) */
.datetime-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.datetime-row input[type="date"],
.datetime-row input[type="time"] {
    width: 100%;
}

.datetime-row input[type="time"] {
    opacity: 0.85;
}

.datetime-row input[type="time"]:not([value=""]),
.datetime-row input[type="time"]:focus {
    opacity: 1;
}

.range-value {
    display: inline-block;
    min-width: 28px;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}

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

/* ============================================================
   SETTINGS
   ============================================================ */

.settings-section {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.settings-section h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.service-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.service {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}

.service:last-child {
    border-bottom: none;
}

.muted {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* ============================================================
   QUESTIONNAIRE
   ============================================================ */

.questionnaire {
    max-width: 600px;
    margin: 0 auto;
}

.questionnaire-progress {
    margin-bottom: 24px;
}

.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s;
}

.question-container {
    background: var(--bg-white);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.question-text {
    font-size: 1.15rem;
    font-weight: 500;
    margin-bottom: 20px;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    padding: 14px 18px;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    font-size: 0.95rem;
}

.option-btn:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.option-btn.selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
}

.questionnaire-result {
    text-align: center;
    padding: 40px;
}

.score-number {
    font-size: 4rem;
    font-weight: 700;
    color: var(--primary);
}

.score-label {
    font-size: 1.5rem;
    color: var(--text-light);
}

/* ============================================================
   TOASTS
   ============================================================ */

.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    color: white;
    font-weight: 500;
    animation: toastIn 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.info { background: var(--primary); }

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

/* ============================================================
   CONFETTI
   ============================================================ */

#confetti-container {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    top: -10px;
    animation: confettiFall 3s ease-out forwards;
}

.confetti:nth-child(odd) { border-radius: 50%; }
.confetti:nth-child(even) { transform: rotate(45deg); }

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ============================================================
   CALENDAR PREVIEW
   ============================================================ */

.calendar-preview {
    background: var(--bg-white);
    padding: 20px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.calendar-preview h3 {
    font-size: 1rem;
    margin-bottom: 12px;
}

/* ============================================================
   POMODORO TIMER
   ============================================================ */

.pomodoro-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.pomodoro-timer {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 40px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.timer-display {
    font-size: 5rem;
    font-weight: 700;
    color: var(--text-dark);
    font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
    letter-spacing: -2px;
    margin-bottom: 8px;
}

.timer-separator {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

.timer-label {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 20px;
}

.timer-label.work {
    color: #EF4444;
}

.timer-label.break {
    color: var(--success);
}

.timer-progress {
    height: 8px;
    background: var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.timer-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #EF4444);
    width: 100%;
    transition: width 1s linear;
}

.timer-progress-bar.break {
    background: linear-gradient(90deg, var(--success), #10B981);
}

.pomodoro-task {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.pomodoro-task-label {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.pomodoro-task-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.pomodoro-task-name.active {
    color: var(--primary);
}

.pomodoro-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.pomodoro-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-bottom: 24px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

.pomodoro-settings {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: left;
}

.pomodoro-settings h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-dark);
}

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

.setting-row:last-child {
    margin-bottom: 0;
}

.setting-row label {
    font-size: 0.9rem;
    color: var(--text-gray);
}

.setting-row select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    background: var(--bg-light);
}

/* Mode focus actif */
.pomodoro-active .timer-display {
    color: #EF4444;
}

.pomodoro-break .timer-display {
    color: var(--success);
}

/* ============================================================
   STATISTICS
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-card-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 4px;
}

.stat-card-label {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 8px;
}

.stat-card-compare {
    font-size: 0.8rem;
    color: var(--text-light);
}

.stat-card-compare .compare-value {
    font-weight: 600;
}

.stat-card-compare .compare-value.positive {
    color: var(--success);
}

.stat-card-compare .compare-value.negative {
    color: var(--error);
}

.stats-chart-container {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.stats-chart-container h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.stats-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 150px;
    gap: 8px;
    padding: 0 10px;
}

.chart-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
}

.chart-bar {
    width: 100%;
    max-width: 40px;
    background: linear-gradient(180deg, var(--primary), var(--primary-light));
    border-radius: 4px 4px 0 0;
    transition: height 0.3s ease;
    min-height: 4px;
}

.chart-bar.today {
    background: linear-gradient(180deg, var(--success), #86EFAC);
}

.chart-bar-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 4px;
}

.chart-bar-label {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 8px;
    text-transform: uppercase;
}

.stats-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.stats-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-dark);
}

.stats-row {
    display: flex;
    justify-content: space-around;
    gap: 20px;
}

.stats-item {
    text-align: center;
}

.stats-item-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary);
}

.stats-item-label {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* ============================================================
   UTILITIES
   ============================================================ */

.hidden {
    display: none !important;
}

/* ============================================================
   RESPONSIVE - Tablettes et mobiles
   ============================================================ */

@media (max-width: 768px) {
    :root {
        --sidebar-width: 70px;
    }

    .logo span:not(.nav-icon) {
        display: none;
    }

    .sidebar-header {
        padding: 16px;
        text-align: center;
    }

    .logo {
        font-size: 1.5rem;
        justify-content: center;
    }

    .logo::after {
        content: none;
    }

    .nav-btn {
        justify-content: center;
        padding: 12px;
    }

    .nav-label {
        display: none;
    }

    .nav-icon {
        font-size: 1.4rem;
    }

    .streak-badge {
        padding: 6px 10px;
        font-size: 0.85rem;
    }

    .streak-label {
        display: none;
    }

    .header {
        padding: 0 16px;
    }

    .energy-slider {
        width: 80px;
    }

    .main {
        padding: 16px;
    }

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

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

    .form-row {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   GESTIONNAIRE DE CATÉGORIES
   ============================================================ */

.categories-manager {
    margin-top: 16px;
}

.categories-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.category-item {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.03) 0%, rgba(147, 51, 234, 0.03) 100%);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s ease;
}

.category-item:hover {
    border-color: rgba(59, 130, 246, 0.25);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.08);
}

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

.category-name {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-dark);
    flex: 1;
    letter-spacing: -0.01em;
}

.category-actions {
    display: flex;
    gap: 4px;
    opacity: 0.5;
}

.category-item:hover .category-actions {
    opacity: 1;
}

.subcategories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    padding-left: 12px;
}

.subcategory-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #e0f2fe 0%, #ddd6fe 100%);
    color: #4338ca;
    padding: 6px 12px;
    border: none;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.1);
}

.subcategory-tag:hover {
    background: linear-gradient(135deg, #bae6fd 0%, #c4b5fd 100%);
    color: #3730a3;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(99, 102, 241, 0.2);
}

.subcategory-tag .subcategory-name {
    margin-right: 2px;
}

.subcategory-tag .btn-edit,
.subcategory-tag .btn-remove {
    background: rgba(255, 255, 255, 0.6);
    border: none;
    color: #6366f1;
    cursor: pointer;
    font-size: 0.7rem;
    line-height: 1;
    padding: 2px 4px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}

.subcategory-tag:hover .btn-edit,
.subcategory-tag:hover .btn-remove {
    opacity: 1;
}

.subcategory-tag .btn-edit:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #4338ca;
}

.subcategory-tag .btn-remove:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.add-subcategory {
    display: flex;
    gap: 4px;
}

.subcategory-input {
    width: 120px;
    padding: 6px 12px;
    border: 2px dashed rgba(99, 102, 241, 0.3);
    border-radius: 20px;
    font-size: 0.82rem;
    background: rgba(99, 102, 241, 0.05);
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.subcategory-input:focus {
    border-style: solid;
    border-color: var(--primary);
    background: white;
    outline: none;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.category-add-form {
    display: flex;
    gap: 8px;
}

.category-add-form input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* ============================================================
   ESTIMATION IA
   ============================================================ */

.duration-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}

.duration-input-wrapper input {
    flex: 1;
}

#btn-estimate-duration {
    white-space: nowrap;
}

.ai-estimation {
    margin-top: 8px;
    padding: 10px;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.ai-estimation.success {
    background: #ECFDF5;
    border-left: 3px solid var(--success);
}

.ai-estimation.error {
    background: #FEF2F2;
    border-left: 3px solid var(--error);
}

/* Badge difficulté */
.badge.difficulty {
    background: #FEE2E2;
    color: #991B1B;
}

/* ============================================================
   DÉTAIL TÂCHE - Actions améliorées
   ============================================================ */

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.detail-actions .btn {
    flex: 1;
    min-width: 120px;
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-badge.todo {
    background: #FEF3C7;
    color: #92400E;
}

.status-badge.completed {
    background: #D1FAE5;
    color: #065F46;
}

/* Bouton warning (réactiver) */
.btn-warning, .btn.btn-warning {
    background: #F59E0B;
    color: white;
}

.btn-warning:hover, .btn.btn-warning:hover {
    background: #D97706;
}

/* Modal d'édition amélioré */
#modal-edit-task .modal-content {
    max-width: 500px;
    padding: 0;
}

#modal-edit-task .modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

#modal-edit-task form {
    padding: 20px 24px;
}

#modal-edit-task .form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

#modal-edit-task .form-group {
    margin-bottom: 16px;
}

#modal-edit-task .form-group label {
    font-size: 0.85rem;
    color: var(--text-gray);
    display: block;
    margin-bottom: 6px;
}

#modal-edit-task .form-group input[type="text"],
#modal-edit-task .form-group input[type="number"],
#modal-edit-task .form-group input[type="date"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

#modal-edit-task select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: white;
    font-size: 1rem;
}

#modal-edit-task .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* ============================================================
   DEADLINE / ÉCHÉANCE BADGES
   ============================================================ */

/* Badge de date d'échéance */
.badge.due-date {
    background: #F1F5F9;
    color: #475569;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Aujourd'hui - Date indicative */
.badge.due-date.today {
    background: #FFF7ED;
    color: #C2410C;
    font-weight: 600;
}

/* Aujourd'hui - Deadline stricte */
.badge.due-date.today-strict {
    background: #FEE2E2;
    color: #DC2626;
    font-weight: 700;
    animation: pulse-urgent 1.5s ease-in-out infinite;
}

/* Demain - Date indicative */
.badge.due-date.tomorrow {
    background: #FEF9C3;
    color: #A16207;
}

/* Demain - Deadline stricte */
.badge.due-date.tomorrow-strict {
    background: #FFEDD5;
    color: #EA580C;
    font-weight: 600;
}

/* Cette semaine - Date indicative */
.badge.due-date.week {
    background: #E0F2FE;
    color: #0369A1;
}

/* Cette semaine - Deadline stricte */
.badge.due-date.week-strict {
    background: #FEF3C7;
    color: #B45309;
}

/* En retard - Date indicative */
.badge.due-date.overdue {
    background: #FECACA;
    color: #DC2626;
    font-weight: 600;
}

/* En retard - Deadline stricte */
.badge.due-date.overdue-strict {
    background: #DC2626;
    color: white;
    font-weight: 700;
    animation: pulse-overdue 1s ease-in-out infinite;
}

/* Badge deadline stricte */
.badge.due-date.strict::after {
    content: '⚠️';
    margin-left: 2px;
    font-size: 0.65rem;
}

/* Carte de tâche en retard */
.task-card.overdue {
    border-left: 4px solid #DC2626;
    background: linear-gradient(90deg, #FEF2F2 0%, white 100%);
}

/* Animation pour urgence */
@keyframes pulse-urgent {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.02); }
}

@keyframes pulse-overdue {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Formulaire - Toggle deadline stricte */
.deadline-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.deadline-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.deadline-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #DC2626;
}

.deadline-toggle .toggle-label {
    font-weight: 500;
    color: var(--text-dark);
}

.deadline-toggle .hint {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-top: 4px;
}

/* Indicateurs dans les détails */
.strict-indicator {
    color: #DC2626;
    font-weight: 600;
    font-size: 0.85rem;
    margin-left: 8px;
}

.flexible-indicator {
    color: #059669;
    font-size: 0.85rem;
    margin-left: 8px;
}

/* Input date styling */
input[type="date"] {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    width: 100%;
    background: white;
}

input[type="date"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============================================================
   MODÈLES - Styles pour les modèles de tâches
   ============================================================ */

/* Bouton filtre Modèles */
.filter-btn.filter-template {
    background: #EEF2FF;
    color: #4F46E5;
    border: 1px dashed #C7D2FE;
}

.filter-btn.filter-template:hover {
    background: #E0E7FF;
    border-color: #A5B4FC;
}

.filter-btn.filter-template.active {
    background: #4F46E5;
    color: white;
    border: 1px solid #4F46E5;
}

/* Carte de modèle */
.task-card.template {
    background: linear-gradient(90deg, #EEF2FF 0%, #E0E7FF 100%);
    border-left: 4px solid #6366F1;
}

.task-card.template:hover {
    background: linear-gradient(90deg, #E0E7FF 0%, #C7D2FE 100%);
}

.task-card.template .task-name {
    color: #4338CA;
}

/* Icône modèle sur les cartes */
.task-template-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

/* Bouton Enregistrer comme modèle */
.btn.btn-template {
    background: #EEF2FF;
    color: #4F46E5;
    border: 1px solid #C7D2FE;
}

.btn.btn-template:hover {
    background: #E0E7FF;
    border-color: #A5B4FC;
}

/* Bouton actions secondaires */
.btn.btn-archive {
    background: #F3F4F6;
    color: #374151;
    border: 1px solid #D1D5DB;
}

.btn.btn-archive:hover {
    background: #E5E7EB;
    border-color: #9CA3AF;
}

/* Bouton danger (supprimer) */
.btn.btn-danger {
    background: #FEE2E2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.btn.btn-danger:hover {
    background: #DC2626;
    color: white;
    border-color: #DC2626;
}

/* ============================================================
   CARTES ENRICHIES - Métadonnées supplémentaires
   ============================================================ */

/* Ligne métadonnées (catégorie, durée) */
.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 0.8rem;
}

/* Catégorie de tâche */
.task-category {
    color: var(--primary);
    font-weight: 500;
    background: rgba(99, 102, 241, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Durée estimée */
.task-duration {
    color: var(--text-gray);
    background: var(--bg-light);
    padding: 2px 8px;
    border-radius: 4px;
}

/* Badges avec icônes */
.badge.impact {
    background: #DCFCE7;
    color: #166534;
}

.badge.urgency {
    background: #FEF3C7;
    color: #92400E;
}

.badge.difficulty {
    background: #DBEAFE;
    color: #1E40AF;
}

/* Score avec tooltip */
.task-score {
    position: relative;
    cursor: help;
}

.task-score::before {
    content: '★';
    margin-right: 2px;
    font-size: 0.9rem;
}

/* ============================================================
   RESPONSIVE - Adaptations mobiles pour les modèles
   ============================================================ */

@media (max-width: 768px) {
    .task-meta {
        font-size: 0.75rem;
    }

    .task-category,
    .task-duration {
        padding: 1px 6px;
    }

    .filter-btn.filter-template {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
}

/* ============================================================
   TÂCHES TERMINÉES - Historique des 30 derniers jours
   ============================================================ */

/* Bouton filtre Terminées */
.filter-btn.filter-completed {
    background: #ECFDF5;
    color: #059669;
    border: 1px solid #A7F3D0;
}

.filter-btn.filter-completed:hover {
    background: #D1FAE5;
    border-color: #6EE7B7;
}

.filter-btn.filter-completed.active {
    background: #059669;
    color: white;
    border: 1px solid #059669;
}

/* Conteneur des tâches terminées - désactiver le grid du parent */
.tasks-list:has(.completed-date-group) {
    display: block !important;
}

/* Groupe par date */
.completed-date-group {
    margin-bottom: 2rem;
}

.completed-date-header {
    font-size: 1rem;
    font-weight: 600;
    color: #6B7280;
    padding: 0.75rem 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid #E5E7EB;
    text-transform: capitalize;
}

/* Grille des tâches terminées (même style que tasks-list) */
.completed-tasks-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 12px !important;
}

/* Icône terminé sur les cartes */
.task-completed-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

/* Bouton dupliquer */
.btn-duplicate {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    opacity: 0.6;
}

.btn-duplicate:hover {
    background: #E0E7FF;
    opacity: 1;
    transform: scale(1.1);
}

/* Détail tâche terminée */
.task-detail-info {
    background: #F9FAFB;
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
}

.task-detail-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.task-detail-scores {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.score-item {
    text-align: center;
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    min-width: 80px;
}

.score-label {
    display: block;
    font-size: 0.75rem;
    color: #6B7280;
    margin-bottom: 0.25rem;
}

.score-value {
    font-size: 1.1rem;
    font-weight: 600;
}

.task-detail-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Bouton Archiver dans le modal */
.btn-archive {
    background: #F3F4F6;
    color: #6B7280;
    border: 1px dashed #D1D5DB;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.btn-archive:hover {
    background: #E5E7EB;
    border-color: #9CA3AF;
    color: #374151;
}

@media (max-width: 768px) {
    .filter-btn.filter-completed {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .completed-date-header {
        font-size: 0.85rem;
    }

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

    .task-detail-scores {
        flex-wrap: wrap;
    }

    .score-item {
        min-width: 70px;
    }

    .task-detail-actions {
        flex-direction: column;
    }

    .task-detail-actions .btn {
        width: 100%;
    }
}

/* ============================================================
   PLANNING - VUE CALENDRIER/TIMELINE
   ============================================================ */

.planning-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.planning-section {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.planning-section.empty {
    display: none;
}

.planning-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-light);
    border-bottom: 1px solid var(--border);
}

.planning-section-icon {
    font-size: 1.25rem;
}

.planning-section-title {
    flex: 1;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

.planning-section-count {
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
}

/* Couleurs spécifiques par section */
.planning-overdue .planning-section-header {
    background: #FEE2E2;
    border-bottom-color: #FECACA;
}

.planning-overdue .planning-section-count {
    background: var(--error);
}

.planning-today .planning-section-header {
    background: #DBEAFE;
    border-bottom-color: #BFDBFE;
}

.planning-today .planning-section-count {
    background: #2563EB;
}

.planning-tomorrow .planning-section-header {
    background: #E0E7FF;
    border-bottom-color: #C7D2FE;
}

.planning-tomorrow .planning-section-count {
    background: var(--primary);
}

.planning-no-date .planning-section-header {
    background: #FEF3C7;
    border-bottom-color: #FDE68A;
}

.planning-no-date .planning-section-count {
    background: var(--warning);
}

/* Liste des tâches dans le planning */
.planning-tasks {
    padding: 0.5rem;
}

.planning-tasks:empty::after {
    content: "Aucune tâche";
    display: block;
    padding: 1rem;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

/* Carte de tâche dans le planning */
.planning-task {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s;
}

.planning-task:hover {
    background: var(--bg-light);
}

.planning-task-checkbox {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: white;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.planning-task-checkbox:hover {
    border-color: var(--primary);
}

.planning-task-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
}

.planning-task-content {
    flex: 1;
    min-width: 0;
}

.planning-task-name {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.planning-task.completed .planning-task-name {
    text-decoration: line-through;
    color: var(--text-light);
}

.planning-task-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.planning-task-date {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.planning-task-date.strict {
    color: var(--error);
    font-weight: 500;
}

.planning-task-category {
    background: var(--bg-light);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.planning-task-badges {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.planning-task-badges .badge {
    font-size: 0.7rem;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: var(--bg-light);
}

.planning-task-badges .badge.urgency {
    background: #FEF3C7;
}

.planning-task-badges .badge.impact {
    background: #DBEAFE;
}

/* Section vide cachée */
.planning-section.hidden {
    display: none;
}

/* Animation d'entrée */
.planning-task {
    animation: slideIn 0.3s ease-out;
}

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

/* Responsive Planning */
@media (max-width: 768px) {
    .planning-section-header {
        padding: 0.75rem 1rem;
    }

    .planning-task {
        padding: 0.6rem 0.75rem;
    }

    .planning-task-name {
        font-size: 0.9rem;
    }

    .planning-task-badges {
        display: none;
    }

    .planning-task-meta {
        font-size: 0.75rem;
    }
}

/* ============================================================
   BOUTON AJOUTER TÂCHE - SIDEBAR
   ============================================================ */

.sidebar-add-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: calc(100% - 1.5rem);
    margin: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.sidebar-add-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.sidebar-add-btn:active {
    transform: translateY(0);
}

.sidebar-add-btn .add-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    font-size: 1rem;
    font-weight: bold;
}

.sidebar-add-btn .add-label {
    flex: 1;
    text-align: left;
    font-size: 0.8rem;
}

/* Conteneur des boutons d'ajout */
.sidebar-add-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem 0.75rem;
}

.sidebar-add-buttons .sidebar-add-btn {
    margin: 0;
    width: 100%;
}

/* Bouton Nouveau Projet */
.sidebar-add-btn.project-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.3);
}

.sidebar-add-btn.project-btn:hover {
    box-shadow: 0 4px 12px rgba(0, 212, 170, 0.4);
}

.sidebar-add-btn.project-btn .add-icon {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================================
   MODAL CRÉATION INTELLIGENTE
   ============================================================ */

.modal-smart {
    max-width: 600px;
    width: 95%;
}

.smart-mode-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border);
}

.smart-tab {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-gray);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.smart-tab:hover {
    color: var(--primary);
}

.smart-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.smart-tab .tab-icon {
    font-size: 1.25rem;
}

.smart-mode {
    display: none;
}

.smart-mode.active {
    display: block;
}

.smart-hint {
    color: var(--text-gray);
    font-size: 0.9rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

/* Zone de saisie avec micro */
.smart-input-wrapper {
    position: relative;
    margin-bottom: 1rem;
}

.smart-input-wrapper textarea {
    width: 100%;
    padding: 1rem;
    padding-right: 60px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    resize: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.smart-input-wrapper textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.smart-input-wrapper textarea::placeholder {
    color: var(--text-light);
}

/* Bouton micro */
.btn-mic {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mic:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.btn-mic:hover .mic-icon {
    filter: grayscale(1) brightness(10);
}

.btn-mic.recording {
    background: var(--error);
    border-color: var(--error);
    animation: pulse-mic 1s ease-in-out infinite;
}

.btn-mic.recording .mic-icon {
    filter: grayscale(1) brightness(10);
}

@keyframes pulse-mic {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

.mic-icon {
    font-size: 1.25rem;
}

/* Statut de la reconnaissance vocale */
.voice-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: #FEF3C7;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
}

.voice-indicator {
    width: 10px;
    height: 10px;
    background: var(--error);
    border-radius: 50%;
    animation: blink 1s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.voice-text {
    font-size: 0.9rem;
    color: #92400E;
}

/* Bouton analyser */
.btn-analyze {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
    margin-bottom: 1.5rem;
}

.btn-analyze:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Aperçu de la tâche proposée */
.smart-preview {
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
    animation: fadeIn 0.3s ease;
}

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

.smart-preview h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.preview-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.preview-card .form-group {
    margin-bottom: 1rem;
}

.preview-card .form-group:last-child {
    margin-bottom: 0;
}

.preview-card label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-gray);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: white;
}

.preview-scores {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.preview-scores input[type="range"] {
    width: 100%;
}

.preview-scores .range-value {
    display: inline-block;
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    color: var(--primary);
}

/* Explication de l'IA */
.ai-explanation {
    margin-top: 1rem;
    padding: 0.875rem;
    background: #DBEAFE;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: #1E40AF;
    line-height: 1.5;
}

.ai-explanation::before {
    content: "💡 ";
}

/* Bouton full width */
.btn-full {
    width: 100%;
    padding: 1rem;
    font-size: 1.05rem;
}

/* Loading state */
.btn.loading {
    position: relative;
    color: transparent !important;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar-add-btn {
        margin: 0.75rem;
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .sidebar-add-btn .add-icon {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }

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

    .smart-mode-tabs {
        padding: 0 1rem;
    }

    .smart-tab {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .preview-scores {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .preview-card .form-row {
        flex-direction: column;
    }
}

/* ============================================================
   GOOGLE CALENDAR INTEGRATION
   ============================================================ */

/* Section paramètres Google Calendar */
.google-calendar-settings {
    background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
    border: 1px solid #BAE6FD;
    border-radius: var(--radius);
    padding: 1.5rem;
}

.google-calendar-settings h3 {
    color: #0369A1;
    margin-bottom: 1rem;
}

.google-status.hidden {
    display: none;
}

.google-benefits {
    list-style: none;
    margin: 1rem 0;
    padding-left: 0;
}

.google-benefits li {
    padding: 0.5rem 0;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.google-success {
    color: var(--success);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Sélection des calendriers */
.calendar-selection {
    margin: 1.5rem 0;
}

.calendar-selection h4 {
    font-size: 0.95rem;
    color: var(--text-dark);
    margin: 1.25rem 0 0.5rem;
}

.calendar-selection h4:first-child {
    margin-top: 0;
}

.calendars-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.calendar-checkbox {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-checkbox:hover {
    border-color: var(--primary-light);
    background: #F8FAFC;
}

.calendar-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.calendar-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.calendar-checkbox .badge {
    margin-left: auto;
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: var(--primary-light);
    color: var(--primary-dark);
    border-radius: 10px;
}

.select-calendar {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: white;
    cursor: pointer;
    margin-top: 0.5rem;
}

.select-calendar:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.google-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.btn-danger-outline {
    background: transparent;
    color: var(--error);
    border: 1px solid var(--error);
}

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

/* Modal Export Calendar */

/* ============================================================
   VUE FOCUS PROJET (affichage dédié 3 niveaux)
   ============================================================ */

.project-view {
    background: var(--bg-white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    width: 100%;
    max-width: none;
    min-width: 100%;
}

/* Header compact avec toutes les infos en ligne */
.project-view-header {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-view-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-back {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

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

.project-view-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.project-view-header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Barre de progression dans le header */
.project-view-header .progress-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
}

.project-view-header .progress-bar-mini {
    width: 100px;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.project-view-header .progress-fill {
    height: 100%;
    background: white;
    transition: width 0.3s ease;
}

.project-view-header .progress-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.project-view-header .meta-inline {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Section info + actions combinée */
.project-view-toolbar {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3b82f608 0%, #1d4ed808 100%);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.project-view-toolbar .toolbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.project-view-toolbar .toolbar-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-view-toolbar .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

/* Liste des tâches optimisée */
.project-view-tasks {
    padding: 1rem 1.5rem 1.5rem;
    width: 100%;
}

.project-view-tasks h3 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.project-tasks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.tasks-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Tâche niveau 1 COMPACTE dans la vue projet */
.project-task-item {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: all 0.15s;
    width: 100%;
}

.project-task-item:hover {
    border-color: #3b82f660;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.15);
}

.project-task-item.completed {
    opacity: 0.6;
    background: var(--bg-gray);
}

.project-task-item.completed .task-name {
    text-decoration: line-through;
    color: var(--text-gray);
}

.task-level1 {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    gap: 0.75rem;
    width: 100%;
}

.task-reorder-controls {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.task-reorder-controls .btn-reorder {
    background: var(--bg-gray);
    border: none;
    width: 20px;
    height: 16px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.6rem;
    color: var(--text-gray);
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}

.task-reorder-controls .btn-reorder:hover:not(.disabled) {
    background: #3b82f6;
    color: white;
}

.task-reorder-controls .btn-reorder.disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.task-level1 .task-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    font-size: 0.75rem;
}

.task-level1 .task-checkbox:hover {
    border-color: #3b82f6;
}

.task-level1 .task-checkbox.checked {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.task-main {
    flex: 1;
    cursor: pointer;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.task-main:hover {
    background: #f8f8fc;
    border-radius: var(--radius-sm);
}

.task-name-row {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    overflow: hidden;
}

.task-name-row .task-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    min-width: 0;
}

.task-name-row .task-score {
    font-weight: 700;
    color: #3b82f6;
    font-size: 0.85rem;
    white-space: nowrap;
}

.task-info-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
}

.task-badges-mini {
    font-size: 0.75rem;
    opacity: 0.7;
}

.subtasks-count {
    background: #3b82f620;
    color: #3b82f6;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.7rem;
    font-weight: 600;
}

.task-actions-mini {
    display: flex;
    gap: 0.25rem;
}

.btn-icon {
    background: transparent;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.15s;
    opacity: 0.5;
}

.btn-icon:hover {
    background: #3b82f620;
    opacity: 1;
}

.btn-icon.delete:hover {
    background: #fee2e2;
}

/* Sous-tâches niveau 2 COMPACTES */
.subtasks-level2 {
    background: #f8f8fc;
    border-top: 1px dashed var(--border);
    padding: 0.5rem 1rem 0.5rem 3rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.subtask-level2-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-white);
    border-radius: var(--radius-sm);
    transition: all 0.15s;
    font-size: 0.9rem;
    width: 100%;
}

.subtask-level2-item:hover {
    background: #f0f0ff;
}

.subtask-level2-item.completed {
    opacity: 0.5;
}

.subtask-level2-item.completed .subtask-name {
    text-decoration: line-through;
    color: var(--text-gray);
}

.subtask-reorder {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.btn-reorder-small {
    background: transparent;
    border: none;
    width: 16px;
    height: 12px;
    cursor: pointer;
    font-size: 0.55rem;
    color: var(--text-gray);
    border-radius: 2px;
    padding: 0;
    line-height: 1;
}

.btn-reorder-small:hover:not(.disabled) {
    background: #3b82f6;
    color: white;
}

.btn-reorder-small.disabled {
    opacity: 0.2;
    cursor: not-allowed;
}

.subtask-level2-item .subtask-checkbox {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.6rem;
    flex-shrink: 0;
}

.subtask-level2-item .subtask-checkbox:hover {
    border-color: #3b82f6;
}

.subtask-level2-item .subtask-checkbox.checked {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.subtask-icon {
    color: #3b82f6;
    font-size: 0.8rem;
}

.subtask-name {
    flex: 1;
    cursor: pointer;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.subtask-name:hover {
    color: #3b82f6;
}

.subtask-duration {
    color: var(--text-gray);
    font-size: 0.8rem;
    white-space: nowrap;
}

.btn-icon-small {
    background: transparent;
    border: none;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 0.65rem;
    border-radius: 3px;
    opacity: 0.4;
    transition: all 0.15s;
}

.btn-icon-small:hover {
    opacity: 1;
}

.btn-icon-small.delete:hover {
    background: #fee2e2;
}

.project-view .empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.project-view .empty-state p {
    margin-bottom: 1rem;
}

/* Dark mode pour vue projet */
[data-theme="dark"] .project-view {
    background: var(--bg-card);
}

[data-theme="dark"] .project-view-info {
    background: linear-gradient(135deg, #3b82f620 0%, #1d4ed820 100%);
}

[data-theme="dark"] .project-view-meta .meta-item {
    background: var(--bg-gray);
}

[data-theme="dark"] .project-task-item {
    background: var(--bg-card);
}

[data-theme="dark"] .subtasks-level2 {
    background: var(--bg-gray);
}

[data-theme="dark"] .subtask-level2-item {
    background: var(--bg-card);
}

[data-theme="dark"] .subtask-level2-item:hover {
    background: var(--bg-hover);
}

/* Responsive */
@media (max-width: 768px) {
    .project-view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .project-view-actions {
        flex-direction: column;
    }

    .project-view-actions .btn {
        width: 100%;
    }

    .task-level1 {
        flex-wrap: wrap;
    }

    .task-info-row {
        width: 100%;
    }

    .subtasks-level2 {
        padding-left: 1.5rem;
    }
}

/* Modal création de projet */
.modal-project {
    max-width: 480px;
}

.modal-project .modal-header h3 {
    color: #3b82f6;
}

.modal-project .form-info.project-info {
    background: linear-gradient(135deg, #3b82f610 0%, #1d4ed810 100%);
    border-left: 4px solid #3b82f6;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
}

.modal-project .form-info.project-info p {
    margin: 0.25rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-project .btn-primary.project-submit {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.modal-project .btn-primary.project-submit:hover {
    background: linear-gradient(135deg, #2563eb 0%, #009d7a 100%);
}

/* Badge PROJET dans le modal de détail */
.project-badge-large {
    display: inline-block;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 6px;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.task-detail.project-detail {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
}

/* Modal tâche de projet */
.modal-project-task .modal-header h3 {
    color: #3b82f6;
}

.modal-export {
    max-width: 500px;
}

.export-task-info {
    background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--primary);
}

.export-task-info h4 {
    margin: 0 0 0.5rem;
    color: var(--primary-dark);
    font-size: 1.1rem;
}

.export-task-info .task-category {
    margin: 0;
    color: var(--text-gray);
    font-size: 0.9rem;
}

.export-form .form-group {
    margin-bottom: 1.25rem;
}

.export-form label {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.export-form input[type="datetime-local"],
.export-form input[type="number"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 1rem;
}

.export-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Créneaux suggérés */
.suggested-slots-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.suggested-slots-section h4 {
    color: #7C3AED;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.suggested-slots {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.loading-slots {
    text-align: center;
    color: var(--text-gray);
    padding: 1rem;
    font-style: italic;
}

.suggested-slot {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #F5F3FF 0%, #EDE9FE 100%);
    border: 1px solid #DDD6FE;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.suggested-slot:hover {
    background: linear-gradient(135deg, #EDE9FE 0%, #DDD6FE 100%);
    transform: translateX(4px);
    border-color: #93c5fd;
}

.suggested-slot.selected {
    border-color: #7C3AED;
    box-shadow: 0 0 0 2px rgba(0, 212, 170, 0.2);
}

.slot-time {
    display: block;
    font-weight: 600;
    color: #5B21B6;
    font-size: 0.95rem;
    text-transform: capitalize;
}

.slot-reason {
    display: block;
    font-size: 0.8rem;
    color: #7C3AED;
    margin-top: 0.25rem;
}

/* Modal actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

/* Bouton calendrier dans détails tâche */
.btn-calendar {
    background: linear-gradient(135deg, #0EA5E9 0%, #0284C7 100%);
    color: white;
    border: none;
}

.btn-calendar:hover {
    background: linear-gradient(135deg, #0284C7 0%, #0369A1 100%);
    transform: translateY(-1px);
}

/* Badge tâche planifiée */
.task-card.scheduled::after {
    content: '📅';
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
}

/* Responsive Google Calendar */
@media (max-width: 768px) {
    .google-calendar-settings {
        padding: 1rem;
    }

    .google-actions {
        flex-direction: column;
    }

    .modal-export {
        width: 95%;
        margin: 1rem;
    }

    .suggested-slot:hover {
        transform: none;
    }
}

/* ============================================================
   SUGGESTIONS IA BASÉES SUR LE CALENDRIER
   ============================================================ */

.event-suggestions-section {
    background: linear-gradient(135deg, #FDF4FF 0%, #FAE8FF 100%);
    border: 1px solid #E9D5FF;
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.section-header-with-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.section-header-with-actions h3 {
    color: #7C3AED;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.suggestions-badge {
    background: var(--error);
    color: white;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
    font-weight: 600;
}

.suggestions-badge.hidden {
    display: none;
}

.section-subtitle {
    color: var(--text-gray);
    font-size: 0.85rem;
    margin: 0 0 1.25rem 0;
}

.event-suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Loading et états vides */
.suggestions-loading {
    text-align: center;
    padding: 2rem;
}

.suggestions-loading .loader {
    width: 40px;
    height: 40px;
    border: 3px solid #E9D5FF;
    border-top-color: #7C3AED;
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 0.8s linear infinite;
}

.suggestions-loading p {
    color: #7C3AED;
    font-style: italic;
}

.no-suggestions {
    text-align: center;
    padding: 2rem;
    color: var(--text-gray);
}

.no-suggestions p {
    margin: 0;
}

.suggestions-error {
    text-align: center;
    padding: 2rem;
    color: var(--error);
}

/* Groupe d'événement */
.event-suggestion-group {
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid #E9D5FF;
    overflow: hidden;
}

.event-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #EDE9FE 0%, #DDD6FE 100%);
    border-bottom: 1px solid #E9D5FF;
}

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

.event-info h4 {
    margin: 0;
    color: #5B21B6;
    font-size: 1rem;
}

.event-date {
    font-size: 0.8rem;
    color: #7C3AED;
    text-transform: capitalize;
}

/* Tâches suggérées */
.suggested-tasks {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.suggested-task {
    background: #FAFAFA;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 1rem;
    transition: all 0.2s;
}

.suggested-task:hover {
    border-color: #93c5fd;
    box-shadow: 0 2px 8px rgba(0, 212, 170, 0.1);
}

.task-main {
    margin-bottom: 0.75rem;
}

.task-name {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.task-reason {
    display: block;
    font-size: 0.8rem;
    color: var(--text-gray);
    font-style: italic;
}

.task-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.meta-badge {
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background: #F3F4F6;
    color: var(--text-gray);
}

.meta-badge.impact {
    background: #FEF3C7;
    color: #92400E;
}

.meta-badge.duration {
    background: #DBEAFE;
    color: #1E40AF;
}

.meta-badge.deadline {
    background: #FCE7F3;
    color: #9D174D;
}

.task-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-gray);
    border: none;
    padding: 0.4rem 0.6rem;
}

.btn-ghost:hover {
    background: #F3F4F6;
    color: var(--text-dark);
}

/* Actions groupées */
.suggestions-bulk-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid #E9D5FF;
}

.suggestions-bulk-actions.hidden {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .event-suggestions-section {
        padding: 1rem;
    }

    .section-header-with-actions {
        flex-direction: column;
        align-items: flex-start;
    }

    .task-meta {
        flex-direction: column;
    }

    .task-actions {
        width: 100%;
    }

    .task-actions .btn {
        flex: 1;
    }

    .suggestions-bulk-actions {
        flex-direction: column;
    }
}

/* ============================================================
   VUE SUGGESTIONS - PAGE DÉDIÉE
   ============================================================ */

/* Badge dans le menu nav */
.nav-btn {
    position: relative;
}

.nav-badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: var(--error);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.nav-badge.hidden {
    display: none;
}

/* Header de la vue suggestions */
.suggestions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
}

.suggestions-intro {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #FDF4FF 0%, #FAE8FF 100%);
    border-radius: var(--radius-sm);
    border-left: 4px solid #A855F7;
}

/* État non connecté */
.suggestions-not-connected {
    padding: 2rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--bg-light);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.suggestions-connected.hidden {
    display: none;
}

.suggestions-not-connected.hidden {
    display: none;
}

/* Teaser sur le dashboard */
.suggestions-teaser {
    background: linear-gradient(135deg, #FDF4FF 0%, #FAE8FF 100%);
    border: 1px solid #E9D5FF;
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.suggestions-teaser.not-connected {
    opacity: 0.6;
}

.teaser-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.teaser-icon {
    font-size: 2rem;
}

.teaser-text h4 {
    margin: 0 0 0.25rem;
    color: #7C3AED;
    font-size: 1rem;
}

.teaser-text p {
    margin: 0;
    color: var(--text-gray);
    font-size: 0.85rem;
}

.teaser-badge {
    background: var(--error);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    margin-left: auto;
}

.teaser-badge.hidden {
    display: none;
}

/* Responsive suggestions */
@media (max-width: 768px) {
    .suggestions-header {
        flex-direction: column;
        align-items: stretch;
    }

    .suggestions-teaser {
        flex-direction: column;
        text-align: center;
    }

    .teaser-content {
        flex-direction: column;
    }

    .teaser-badge {
        margin-left: 0;
    }
}

/* ============================================================
   AGENDA DU JOUR - DASHBOARD
   ============================================================ */

.calendar-preview {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-top: 1.5rem;
    border: 1px solid var(--border);
}

.calendar-preview h3 {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--text-dark);
}

.calendar-events {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.calendar-events .muted {
    color: var(--text-gray);
    font-size: 0.9rem;
    text-align: center;
    padding: 1rem;
}

.today-event {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.today-event:hover {
    background: #F0F4F8;
}

.event-time {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary);
    min-width: 90px;
    white-space: nowrap;
}

.event-title {
    font-size: 0.9rem;
    color: var(--text-dark);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ============================================================
   TOGGLE SWITCH (MODE SOMBRE)
   ============================================================ */

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.setting-label {
    font-weight: 600;
    color: var(--text-dark);
}

.setting-description {
    font-size: 0.85rem;
    color: var(--text-gray);
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 52px;
    height: 28px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--text-light);
    transition: 0.3s;
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(24px);
}

.toggle-switch input:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

/* ============================================================
   MODAL ÉNERGIE MATINALE
   ============================================================ */

.modal-morning {
    max-width: 400px;
    text-align: center;
}

.modal-morning .modal-header h3 {
    font-size: 1.5rem;
}

.morning-intro {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.morning-subtitle {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 1rem;
}

/* Choix du mode */
.morning-mode-choice {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.mode-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    transition: all 0.2s;
}

.mode-btn:hover {
    border-color: var(--primary-light);
}

.mode-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Modes du modal */
.morning-mode.hidden {
    display: none;
}

.morning-energy-control {
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: var(--radius);
}

.energy-emoji {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.morning-energy-control input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #EF4444, #F97316, #EAB308, #22C55E);
    border-radius: 4px;
    outline: none;
}

.morning-energy-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border: 2px solid var(--primary);
}

.energy-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-gray);
}

.morning-energy-value {
    margin-top: 1rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.modal-morning .modal-footer {
    justify-content: space-between;
}

.btn-ghost {
    background: transparent;
    color: var(--text-gray);
    border: none;
}

.btn-ghost:hover {
    color: var(--text-dark);
    background: var(--bg-light);
}

/* Questionnaire matinal intégré */
.morning-questionnaire {
    padding: 1rem;
}

.mq-question-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
    text-align: center;
}

.mq-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mq-option {
    padding: 0.75rem 1rem;
    background: var(--bg-light);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    text-align: left;
}

.mq-option:hover {
    border-color: var(--primary);
    background: var(--primary-light);
    color: var(--primary-dark);
}

.mq-progress {
    margin-top: 1.5rem;
    text-align: center;
}

.mq-progress-text {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.mq-progress-bar {
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    overflow: hidden;
}

.mq-progress-fill {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease;
}

/* Résultat matinal */
.morning-result {
    padding: 2rem;
    text-align: center;
}

.result-emoji {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.result-desc {
    color: var(--text-gray);
    font-size: 0.95rem;
}

#btn-confirm-morning.hidden {
    display: none;
}

/* ============================================================
   GRAPHIQUE ÉNERGIE
   ============================================================ */

.energy-chart {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    height: 150px;
    padding: 1rem 0;
    gap: 8px;
}

.energy-bar-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.energy-bar-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
}

.energy-bar-container {
    width: 100%;
    height: 100px;
    background: var(--bg-light);
    border-radius: 4px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.energy-bar {
    width: 100%;
    border-radius: 4px;
    transition: height 0.3s ease;
}

.energy-bar.low {
    background: linear-gradient(to top, #EF4444, #F87171);
}

.energy-bar.medium {
    background: linear-gradient(to top, #F59E0B, #FBBF24);
}

.energy-bar.high {
    background: linear-gradient(to top, #22C55E, #4ADE80);
}

.energy-bar.empty {
    background: var(--border);
}

.energy-bar.today {
    box-shadow: 0 0 0 2px var(--primary);
}

.energy-bar-label {
    font-size: 0.7rem;
    color: var(--text-gray);
    text-transform: uppercase;
}

.energy-chart-legend {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-gray);
}

.legend-low::before,
.legend-medium::before,
.legend-high::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 4px;
    vertical-align: middle;
}

.legend-low::before {
    background: #EF4444;
}

.legend-medium::before {
    background: #F59E0B;
}

.legend-high::before {
    background: #22C55E;
}
