/* ==========================================
   CORTEX - Admin Notes
   Style unifie avec teddyf.fr
   ========================================== */

:root {
    /* Palette principale (depuis teddyf.fr) */
    --purple: #60519b;
    --purple-light: #7b6cb5;
    --purple-dark: #4a3d7a;
    --dark: #31323c;
    --light: #bfc0d1;
    --bg: #1a1a24;
    --surface: #242430;
    --surface-hover: #2d2d3a;

    /* Couleurs etendues */
    --bg-primary: #0f0e1a;
    --bg-secondary: #1a1828;
    --bg-tertiary: #252336;
    --bg-card: rgba(36, 36, 48, 0.7);
    --bg-card-solid: #1f1d2e;
    --bg-card-hover: rgba(40, 38, 58, 0.9);

    --text-primary: #e8e6f0;
    --text-secondary: #a8a4c0;
    --text-muted: #6e6a85;

    --accent-purple: #8b5cf6;
    --accent-purple-hover: #9d6ff7;
    --accent-purple-light: rgba(139, 92, 246, 0.15);

    --border-color: rgba(96, 81, 155, 0.25);
    --border-hover: rgba(96, 81, 155, 0.5);

    /* Badges de statut */
    --badge-bug: #dc2626;
    --badge-bug-bg: rgba(220, 38, 38, 0.15);
    --badge-idea: #f59e0b;
    --badge-idea-bg: rgba(245, 158, 11, 0.15);
    --badge-todo: #3b82f6;
    --badge-todo-bg: rgba(59, 130, 246, 0.15);
    --badge-done: #10b981;
    --badge-done-bg: rgba(16, 185, 129, 0.15);
    --badge-progress: #8b5cf6;
    --badge-progress-bg: rgba(139, 92, 246, 0.15);

    /* Typographie */
    --font-display: 'IBM Plex Sans', -apple-system, sans-serif;
    --font-mono: 'Space Mono', monospace;

    /* Espacements */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;

    /* Bordures */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;

    /* Ombres */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 30px rgba(96, 81, 155, 0.4);
}

/* ==========================================
   RESET
   ========================================== */

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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-display);
    background: var(--bg);
    color: var(--light);
    line-height: 1.6;
    position: relative;
}

/* ==========================================
   PARTICULES FLOTTANTES
   ========================================== */

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--purple);
    border-radius: 50%;
    opacity: 0;
    animation: particleFloat 15s infinite ease-in-out;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 12s; }
.particle:nth-child(2) { left: 25%; animation-delay: 2s; animation-duration: 15s; }
.particle:nth-child(3) { left: 40%; animation-delay: 4s; animation-duration: 18s; }
.particle:nth-child(4) { left: 55%; animation-delay: 1s; animation-duration: 14s; }
.particle:nth-child(5) { left: 70%; animation-delay: 3s; animation-duration: 16s; }
.particle:nth-child(6) { left: 85%; animation-delay: 5s; animation-duration: 13s; }
.particle:nth-child(7) { left: 15%; animation-delay: 6s; animation-duration: 17s; }
.particle:nth-child(8) { left: 90%; animation-delay: 2.5s; animation-duration: 19s; }

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% { opacity: 0.3; }
    90% { opacity: 0.3; }
    100% {
        transform: translateY(-100px) scale(1);
        opacity: 0;
    }
}

/* ==========================================
   FOND ANIME (Mesh Gradient + Grille)
   ========================================== */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 20%, rgba(96, 81, 155, 0.25) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 80%, rgba(191, 192, 209, 0.15) 0%, transparent 40%),
        radial-gradient(ellipse at 50% 50%, rgba(96, 81, 155, 0.2) 0%, transparent 50%);
    animation: meshMove 15s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes meshMove {
    0%, 100% {
        background-position: 0% 0%, 100% 100%, 50% 50%;
        opacity: 1;
    }
    50% {
        background-position: 20% 30%, 80% 70%, 60% 40%;
        opacity: 0.8;
    }
}

body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 200%;
    height: 200%;
    background-image:
        linear-gradient(45deg, rgba(96, 81, 155, 0.03) 1px, transparent 1px),
        linear-gradient(-45deg, rgba(96, 81, 155, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: gridSlide 30s linear infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes gridSlide {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

/* ==========================================
   PAGES
   ========================================== */

.page {
    display: none;
    position: relative;
    z-index: 1;
}

.page.active {
    display: block;
}

/* ==========================================
   PAGE DE CONNEXION
   ========================================== */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}

.login-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: fadeInUp 0.6s ease;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(96, 81, 155, 0.1), transparent);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 200%; }
}

.login-icon {
    font-size: 3.5rem;
    text-align: center;
    margin-bottom: var(--space-md);
    filter: drop-shadow(0 0 20px rgba(96, 81, 155, 0.5));
}

.login-card h1 {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: var(--space-xs);
    font-weight: 700;
    background: linear-gradient(135deg, var(--light) 0%, var(--purple) 50%, var(--light) 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 6s ease infinite;
}

@keyframes gradientMove {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.login-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    font-size: 0.95rem;
}

.input-group {
    margin-bottom: var(--space-md);
}

.input-group input {
    width: 100%;
    padding: 1rem var(--space-md);
    background: rgba(26, 24, 40, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-display);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--purple);
    background: rgba(37, 35, 54, 0.9);
    box-shadow: 0 0 0 3px rgba(96, 81, 155, 0.2), 0 0 20px rgba(96, 81, 155, 0.1);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

/* ==========================================
   BOUTONS
   ========================================== */

.btn-primary, .btn-secondary {
    padding: 0.9rem var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
    color: white;
    width: 100%;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(96, 81, 155, 0.5), 0 0 40px rgba(96, 81, 155, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-icon {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: scale(1.05);
}

.error-message {
    color: var(--badge-bug);
    font-size: 0.875rem;
    margin-top: var(--space-sm);
    text-align: center;
    display: none;
    padding: var(--space-sm);
    background: var(--badge-bug-bg);
    border-radius: var(--radius-sm);
}

.error-message.show {
    display: block;
    animation: shake 0.5s ease;
}

/* ==========================================
   CONTAINER PRINCIPAL
   ========================================== */

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--space-lg);
    min-height: 100vh;
}

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

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.8s ease-out;
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.header-title {
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    background: linear-gradient(135deg, var(--light) 0%, var(--purple) 50%, var(--light) 100%);
    background-size: 300% 300%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientMove 6s ease infinite;
}

.header-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(96, 81, 155, 0.5));
}

.header-right {
    display: flex;
    gap: var(--space-sm);
}

.header-right .btn-primary,
.header-right .btn-secondary {
    width: auto;
}

/* ==========================================
   NAVIGATION PAR ONGLETS
   ========================================== */

.main-nav {
    display: flex;
    gap: var(--space-xs);
    background: var(--bg-card);
    padding: 0.35rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.nav-tab {
    padding: 0.6rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.nav-tab:hover {
    color: var(--text-primary);
    background: rgba(96, 81, 155, 0.1);
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(96, 81, 155, 0.4);
}

/* ==========================================
   TAB CONTENT
   ========================================== */

.tab-content {
    display: none !important;
    animation: fadeIn 0.3s ease;
}

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

#notesTab,
#projectsTab,
#statsTab {
    display: none !important;
}

#notesTab.active,
#projectsTab.active,
#statsTab.active {
    display: block !important;
}

/* ==========================================
   TOOLBAR
   ========================================== */

.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
}

.toolbar .search-container {
    flex: 1;
    max-width: 400px;
}

.toolbar-actions {
    display: flex;
    gap: var(--space-sm);
    align-items: center;
}

.btn-sm {
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
}

/* ==========================================
   BARRE DE RECHERCHE
   ========================================== */

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-display);
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(96, 81, 155, 0.2);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* ==========================================
   SECTION DES FILTRES
   ========================================== */

.filters-section {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    align-items: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.5s ease 0.1s backwards;
}

.filters-container {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.65rem var(--space-md);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.filter-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--purple) 0%, var(--purple-light) 100%);
    border-color: var(--purple);
    color: white;
    box-shadow: 0 4px 15px rgba(96, 81, 155, 0.4);
}

.btn-add-category {
    padding: 0.65rem var(--space-md);
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-add-category:hover {
    border-color: var(--purple);
    color: var(--purple);
    background: rgba(96, 81, 155, 0.1);
    transform: translateY(-2px);
}

/* ==========================================
   STATISTIQUES
   ========================================== */

.stats-bar {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.5s ease 0.15s backwards;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 0.5rem var(--space-md);
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-item .stat-value {
    font-weight: 700;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.stat-item.todo .stat-value { color: var(--badge-todo); }
.stat-item.progress .stat-value { color: var(--badge-progress); }
.stat-item.done .stat-value { color: var(--badge-done); }

/* ==========================================
   GRILLE DES NOTES
   ========================================== */

.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: var(--space-md);
}

/* ==========================================
   CARTE DE NOTE
   ========================================== */

.note-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    animation: fadeInUp 0.5s ease backwards;
    position: relative;
    overflow: hidden;
}

.note-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(96, 81, 155, 0.15) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.note-card::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, rgba(96, 81, 155, 0.3) 0%, transparent 70%);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
    pointer-events: none;
}

.note-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--purple);
    box-shadow: 0 20px 50px rgba(96, 81, 155, 0.4), 0 0 40px rgba(96, 81, 155, 0.2);
}

.note-card:hover::before {
    opacity: 0.3;
}

.note-card:hover::after {
    width: 300px;
    height: 300px;
}

.note-card.pinned {
    border-color: var(--badge-idea);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

.note-card.pinned::before {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, transparent 100%);
    opacity: 0.3;
}

.pin-indicator {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    font-size: 1.2rem;
    filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.5));
}

.note-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.note-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4rem 0.8rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.note-badge.bugs { background: var(--badge-bug-bg); color: var(--badge-bug); }
.note-badge.ideas { background: var(--badge-idea-bg); color: var(--badge-idea); }
.note-badge.todo { background: var(--badge-todo-bg); color: var(--badge-todo); }
.note-badge.done { background: var(--badge-done-bg); color: var(--badge-done); }

.note-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.note-card:hover .note-actions {
    opacity: 1;
    transform: translateX(0);
}

.note-action-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

.note-action-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-hover);
    transform: scale(1.1);
}

.note-action-btn.pin-btn:hover,
.note-action-btn.pin-btn.pinned {
    background: var(--badge-idea-bg);
    color: var(--badge-idea);
    border-color: var(--badge-idea);
}

.note-action-btn.delete:hover {
    background: var(--badge-bug-bg);
    color: var(--badge-bug);
    border-color: var(--badge-bug);
}

.note-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
    position: relative;
    z-index: 1;
    transition: color 0.3s ease;
}

.note-card:hover .note-title {
    color: white;
}

.note-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

/* Markdown dans les descriptions */
.note-description code {
    background: rgba(96, 81, 155, 0.2);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.85em;
}

.note-description pre {
    background: rgba(26, 24, 40, 0.8);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: var(--space-sm) 0;
}

.note-description pre code {
    background: none;
    padding: 0;
}

.note-description strong {
    color: var(--text-primary);
    font-weight: 600;
}

.note-description em {
    color: var(--purple-light);
}

.note-description a {
    color: var(--accent-purple);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-purple);
    transition: all 0.2s ease;
}

.note-description a:hover {
    color: var(--accent-purple-hover);
    border-bottom-style: solid;
}

.note-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.note-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.note-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.note-status.todo { background: var(--badge-todo-bg); color: var(--badge-todo); }
.note-status.in-progress { background: var(--badge-progress-bg); color: var(--badge-progress); }
.note-status.done { background: var(--badge-done-bg); color: var(--badge-done); }

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

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    width: 90%;
    max-width: 650px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(96, 81, 155, 0.3);
    animation: slideUp 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.modal-small {
    max-width: 420px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.modal-header h2 {
    font-size: 1.6rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--light) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.modal-close {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.modal-close:hover {
    background: var(--badge-bug-bg);
    color: var(--badge-bug);
    border-color: var(--badge-bug);
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: var(--space-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.85rem var(--space-md);
    background: rgba(26, 24, 40, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-display);
    transition: all 0.3s ease;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    font-family: var(--font-mono);
    line-height: 1.6;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(96, 81, 155, 0.2), 0 0 20px rgba(96, 81, 155, 0.1);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23bfc0d1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1rem;
    padding-right: 3rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn-primary,
.modal-footer .btn-secondary {
    width: auto;
    min-width: 120px;
}

/* ==========================================
   ZONE D'UPLOAD D'IMAGES
   ========================================== */

.image-upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    transition: all 0.3s ease;
    background: rgba(26, 24, 40, 0.5);
}

.image-upload-zone:hover {
    border-color: var(--purple);
    background: rgba(96, 81, 155, 0.1);
}

.image-upload-zone.drag-over {
    border-color: var(--purple);
    background: rgba(96, 81, 155, 0.2);
    transform: scale(1.02);
}

.upload-placeholder {
    text-align: center;
    padding: var(--space-lg);
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-placeholder:hover {
    transform: scale(1.02);
}

.upload-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: var(--space-sm);
    filter: drop-shadow(0 0 15px rgba(96, 81, 155, 0.4));
}

.upload-placeholder p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.images-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.image-preview-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.3s ease;
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.image-preview-item:hover img {
    transform: scale(1.1);
}

.image-preview-remove {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    width: 1.75rem;
    height: 1.75rem;
    background: rgba(220, 38, 38, 0.9);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0;
    transform: scale(0.8);
}

.image-preview-item:hover .image-preview-remove {
    opacity: 1;
    transform: scale(1);
}

.image-preview-remove:hover {
    background: var(--badge-bug);
    transform: scale(1.15);
}

/* ==========================================
   IMAGES DANS LES NOTES
   ========================================== */

.note-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-xs);
    margin-top: var(--space-sm);
    margin-bottom: var(--space-md);
    position: relative;
    z-index: 1;
}

.note-image {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.note-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.note-image:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border-color: var(--purple);
    z-index: 2;
}

.note-image:hover img {
    filter: brightness(1.1);
}

/* ==========================================
   VISUALISEUR D'IMAGES
   ========================================== */

.image-viewer-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    align-items: center;
    justify-content: center;
}

.image-viewer-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.image-viewer-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
}

.image-viewer-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.image-viewer-close {
    position: absolute;
    top: -3.5rem;
    right: 0;
    width: 3rem;
    height: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.image-viewer-close:hover {
    background: var(--badge-bug);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.image-viewer-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3.5rem;
    height: 3.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-primary);
    font-size: 1.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.image-viewer-nav:hover {
    background: var(--purple);
    color: white;
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 20px rgba(96, 81, 155, 0.5);
}

.image-viewer-nav.prev { left: -5rem; }
.image-viewer-nav.next { right: -5rem; }

/* ==========================================
   GESTION DES CATEGORIES
   ========================================== */

.categories-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    max-height: 60vh;
    overflow-y: auto;
}

.category-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md);
    background: rgba(26, 24, 40, 0.8);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.category-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(5px);
}

.category-item-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.category-item-emoji {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px rgba(96, 81, 155, 0.3));
}

.category-item-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.category-item-count {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: var(--space-xs);
    font-family: var(--font-mono);
}

.category-item-actions {
    display: flex;
    gap: var(--space-xs);
}

.category-item.default {
    opacity: 0.7;
}

.category-item.default .btn-delete-category {
    display: none;
}

.btn-delete-category {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--badge-bug);
    color: var(--badge-bug);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-delete-category:hover {
    background: var(--badge-bug);
    color: white;
}

.btn-delete-category:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* ==========================================
   RACCOURCIS CLAVIER (AIDE)
   ========================================== */

.shortcuts-help {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 100;
}

.shortcuts-toggle {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortcuts-toggle:hover {
    background: var(--purple);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(96, 81, 155, 0.5);
}

.shortcuts-panel {
    position: absolute;
    bottom: 4rem;
    right: 0;
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    min-width: 280px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.shortcuts-help.active .shortcuts-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.shortcuts-panel h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-primary);
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    font-size: 0.85rem;
}

.shortcut-item span:first-child {
    color: var(--text-secondary);
}

.shortcut-key {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--purple-light);
    border: 1px solid var(--border-color);
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    padding: var(--space-sm) var(--space-lg);
    background: var(--bg-card-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9rem;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.toast.success { border-color: var(--badge-done); }
.toast.error { border-color: var(--badge-bug); }
.toast.info { border-color: var(--purple); }

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

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

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-10px); }
    80% { transform: translateX(10px); }
}

/* Delai d'animation pour les cartes */
.note-card:nth-child(1) { animation-delay: 0.05s; }
.note-card:nth-child(2) { animation-delay: 0.1s; }
.note-card:nth-child(3) { animation-delay: 0.15s; }
.note-card:nth-child(4) { animation-delay: 0.2s; }
.note-card:nth-child(5) { animation-delay: 0.25s; }
.note-card:nth-child(6) { animation-delay: 0.3s; }

/* ==========================================
   EMPTY STATE
   ========================================== */

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state-text {
    font-size: 1.1rem;
    margin-bottom: var(--space-sm);
}

.empty-state-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .notes-grid {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    }

    .search-container {
        max-width: 300px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: var(--space-md);
    }

    .header {
        flex-direction: column;
        gap: var(--space-md);
        align-items: stretch;
    }

    .header-left {
        justify-content: center;
    }

    .header-right {
        flex-direction: column;
    }

    .header-right .btn-primary,
    .header-right .btn-secondary {
        width: 100%;
    }

    .search-container {
        max-width: 100%;
        order: -1;
    }

    .filters-section {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-container {
        justify-content: center;
    }

    .stats-bar {
        flex-wrap: wrap;
        justify-content: center;
    }

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

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

    .modal-content {
        padding: var(--space-lg);
        margin: var(--space-sm);
        max-height: calc(100vh - 2rem);
    }

    .image-viewer-nav.prev { left: var(--space-sm); }
    .image-viewer-nav.next { right: var(--space-sm); }

    .shortcuts-help {
        bottom: var(--space-md);
        right: var(--space-md);
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.5rem;
    }

    .note-card {
        padding: var(--space-md);
    }

    .note-title {
        font-size: 1.1rem;
    }

    .note-actions {
        opacity: 1;
        transform: none;
    }
}

/* ==========================================
   SCROLLBAR PERSONNALISEE
   ========================================== */

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: 5px;
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--purple-dark);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-secondary);
}

/* ==========================================
   ACCESSIBILITE
   ========================================== */

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.filter-btn:focus-visible,
.note-card:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================
   SELECTION DE TEXTE
   ========================================== */

::selection {
    background: rgba(96, 81, 155, 0.4);
    color: white;
}

::-moz-selection {
    background: rgba(96, 81, 155, 0.4);
    color: white;
}

/* ==========================================
   PROJETS - GRILLE
   ========================================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--space-md);
}

.project-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    animation: fadeInUp 0.5s ease backwards;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--project-color, var(--purple));
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--purple);
    box-shadow: 0 15px 40px rgba(96, 81, 155, 0.3);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-md);
}

.project-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: var(--space-md);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.project-status.active { background: var(--badge-done-bg); color: var(--badge-done); }
.project-status.paused { background: var(--badge-idea-bg); color: var(--badge-idea); }
.project-status.completed { background: var(--badge-todo-bg); color: var(--badge-todo); }
.project-status.archived { background: var(--bg-tertiary); color: var(--text-muted); }

.project-actions {
    display: flex;
    gap: 0.5rem;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
}

.project-card:hover .project-actions {
    opacity: 1;
    transform: translateX(0);
}

.project-stats {
    display: flex;
    gap: var(--space-md);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-sm);
}

.project-stat {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.project-stat .value {
    font-weight: 600;
    color: var(--text-primary);
    font-family: var(--font-mono);
}

.project-progress {
    margin-top: var(--space-sm);
}

.progress-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

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

.project-deadline {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-sm);
}

.project-deadline.urgent {
    color: var(--badge-bug);
}

.project-priority {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    font-size: 1rem;
}

/* ==========================================
   STATISTIQUES - PAGE
   ========================================== */

.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: var(--purple);
    box-shadow: 0 10px 30px rgba(96, 81, 155, 0.2);
}

.stat-card-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
    filter: drop-shadow(0 0 10px rgba(96, 81, 155, 0.3));
}

.stat-card-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: var(--font-mono);
    background: linear-gradient(135deg, var(--light) 0%, var(--purple) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-card-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: var(--space-xs);
}

.stat-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.stat-card-sub.positive { color: var(--badge-done); }
.stat-card-sub.negative { color: var(--badge-bug); }

.stats-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: var(--space-lg);
}

.stats-section {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.stats-section h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.stats-chart {
    min-height: 200px;
}

/* Barres horizontales pour les stats */
.chart-bar-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.chart-bar-label {
    min-width: 120px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.chart-bar-track {
    flex: 1;
    height: 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.chart-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--purple) 0%, var(--purple-light) 100%);
    border-radius: var(--radius-sm);
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: var(--space-sm);
    min-width: fit-content;
}

.chart-bar-value {
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    font-family: var(--font-mono);
}

/* Activite timeline */
.activity-timeline {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 120px;
    padding-top: var(--space-sm);
}

.activity-bar {
    flex: 1;
    background: linear-gradient(180deg, var(--purple) 0%, var(--purple-dark) 100%);
    border-radius: 2px 2px 0 0;
    min-height: 4px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.activity-bar:hover {
    background: var(--purple-light);
    transform: scaleY(1.1);
}

.activity-bar::after {
    content: attr(data-count);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--text-muted);
    opacity: 0;
    transition: opacity 0.2s;
}

.activity-bar:hover::after {
    opacity: 1;
}

/* Deadlines liste */
.deadlines-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.deadline-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--project-color, var(--purple));
}

.deadline-item.urgent {
    border-left-color: var(--badge-bug);
    background: var(--badge-bug-bg);
}

.deadline-date {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 80px;
}

.deadline-item.urgent .deadline-date {
    color: var(--badge-bug);
    font-weight: 600;
}

.deadline-project {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.deadline-status {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
}

/* Empty states pour stats */
.stats-empty {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

.stats-empty-icon {
    font-size: 3rem;
    margin-bottom: var(--space-sm);
    opacity: 0.5;
}

/* ==========================================
   RESPONSIVE - NOUVELLES SECTIONS
   ========================================== */

@media (max-width: 768px) {
    .main-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: var(--space-sm);
    }

    .nav-tab {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar .search-container {
        max-width: 100%;
    }

    .toolbar-actions {
        justify-content: flex-end;
    }

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

    .stats-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .stats-details {
        grid-template-columns: 1fr;
    }
}

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

    .project-actions {
        opacity: 1;
        transform: none;
    }
}
