/* sys.quebec - OS Souverain */
/* Fonts are loaded globally from /os/fonts.css */

:root {
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-tertiary: #1a1a25;
    --bg-glass: rgba(18, 18, 26, 0.85);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --accent-blue: #4a9eff;
    --accent-purple: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #4a9eff 0%, #8b5cf6 100%);
    --border-color: rgba(255, 255, 255, 0.08);
    --shadow-glow: 0 0 40px rgba(74, 158, 255, 0.15);
    --taskbar-height: 56px;
    
    /* Grille desktop - variables partagées */
    --desktop-icon-width: 100px;
    --desktop-icon-height: 110px;
    --desktop-grid-gap: 16px;
    --desktop-padding: 32px;
    --desktop-max-columns: 6;
    /* Colonnes calculées dynamiquement par JS */
    --desktop-grid-columns: repeat(var(--desktop-computed-columns, 6), var(--desktop-icon-width));
    --desktop-background: 
        radial-gradient(ellipse at 20% 20%, rgba(74, 158, 255, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(16, 185, 129, 0.06) 0%, transparent 70%),
        var(--bg-primary);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    user-select: none;
}

/* Background avec effet aurore boréale */
.desktop {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--taskbar-height));
    background: var(--desktop-background);
    padding: var(--desktop-padding);
    display: grid;
    grid-template-columns: var(--desktop-grid-columns);
    grid-auto-rows: var(--desktop-icon-height);
    gap: var(--desktop-grid-gap);
    /* Centrage horizontal et vertical */
    justify-content: center;
    align-content: center;
    /* Scroll vertical si nécessaire */
    overflow-y: auto;
    overflow-x: hidden;
    /* Caché par défaut, affiché une fois la grille calculée */
    opacity: 0;
    transition: opacity 0.15s ease;
}

/* Quand la grille déborde et nécessite un scroll, aligner en haut */
.desktop.has-scroll {
    align-content: start;
}

.desktop.grid-ready {
    opacity: 1;
}

/* Icônes d'applications */
.app-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 12px 8px;
    border-radius: 16px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    color: var(--text-primary);
    background: transparent;
    border: none;
    font-family: inherit;
    perspective: 200px;
    -webkit-user-select: none;
    user-select: none;
}

.app-icon:hover {
    background: rgba(255, 255, 255, 0.06);
}

.app-icon:active .app-icon-image {
    transform: scale(0.92) rotateX(0deg) rotateY(0deg);
}

.app-icon-image {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.15s ease-out, box-shadow 0.2s ease;
    transform-style: preserve-3d;
    will-change: transform;
}

.app-icon:hover .app-icon-image {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
}

.app-icon-image svg {
    width: 28px;
    height: 28px;
    stroke: white;
    stroke-width: 1.5;
    fill: none;
    transition: filter 0.15s ease-out;
}

.app-icon:hover .app-icon-image svg {
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.5));
}

.app-icon-label {
    font-size: 12px;
    font-weight: 500;
    text-align: center;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

/* Effet de mise en évidence au clavier */
.app-icon.keyboard-highlight {
    z-index: 100;
}

.app-icon.keyboard-highlight .app-icon-image {
    animation: keyboardHighlight 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 
        0 0 0 3px rgba(0, 0, 0, 0.8),
        0 0 25px rgba(255, 255, 255, 0.6),
        0 0 50px rgba(255, 255, 255, 0.3),
        0 8px 20px rgba(0, 0, 0, 0.4);
}

.app-icon.keyboard-highlight .app-icon-label {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes keyboardHighlight {
    0% {
        transform: scale(1) translateY(0) rotate(0deg);
    }
    15% {
        transform: scale(1.15) translateY(-6px) rotate(-8deg);
    }
    30% {
        transform: scale(1.2) translateY(-8px) rotate(6deg);
    }
    45% {
        transform: scale(1.18) translateY(-7px) rotate(-5deg);
    }
    60% {
        transform: scale(1.15) translateY(-5px) rotate(4deg);
    }
    75% {
        transform: scale(1.1) translateY(-3px) rotate(-2deg);
    }
    90% {
        transform: scale(1.05) translateY(-1px) rotate(1deg);
    }
    100% {
        transform: scale(1) translateY(0) rotate(0deg);
    }
}

/* Badge sur les icônes d'apps */
.app-icon-image {
    position: relative;
}

.app-icon-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 600;
    border-radius: 10px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    border: 2px solid var(--bg-primary);
}

.app-icon-badge.visible {
    display: flex;
}

/* Badge BETA sur les icônes du bureau */
.app-icon-beta-badge {
    position: absolute;
    top: -2px;
    right: -6px;
    padding: 2px 5px;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #fcd34d;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.9));
    border: 1px solid rgba(251, 191, 36, 0.6);
    border-radius: 3px;
    transform: rotate(15deg);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    z-index: 5;
    pointer-events: none;
}

/* Barre des tâches style ChromeOS */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-height);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 16px;
    gap: 8px;
    z-index: 9999;
}

.taskbar-apps {
    /* Centrage absolu par rapport à l'écran, pas à l'espace disponible */
    /* Utilise left/right/margin au lieu de transform pour ne pas casser position:fixed des enfants */
    position: absolute;
    left: 0;
    right: 0;
    margin: 0 auto;
    width: fit-content;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    overflow: visible;
    padding: 0 16px;
    /* Limiter la largeur pour ne pas chevaucher taskbar-end */
    max-width: calc(100% - 300px);
}

/* Bouton Show Desktop - Style identique aux apps de la taskbar */
.taskbar-desktop-btn {
    height: 44px;
    min-width: 44px;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    position: relative;
    flex-shrink: 0;
}

.taskbar-desktop-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.taskbar-desktop-btn:active {
    transform: scale(0.95);
}

.taskbar-desktop-btn.desktop-visible {
    background: rgba(74, 158, 255, 0.18);
    border-color: rgba(74, 158, 255, 0.4);
    box-shadow: 
        0 0 12px rgba(74, 158, 255, 0.25),
        inset 0 0 8px rgba(74, 158, 255, 0.1);
}

.taskbar-desktop-btn.desktop-visible::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(74, 158, 255, 0.6);
}

.taskbar-desktop-btn.desktop-visible:hover {
    background: rgba(74, 158, 255, 0.24);
}

.taskbar-desktop-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.15s ease;
}

.taskbar-desktop-btn:hover svg {
    stroke: var(--text-primary);
}

.taskbar-desktop-btn.desktop-visible svg {
    stroke: #ffffff;
    text-shadow: 0 0 8px rgba(74, 158, 255, 0.4);
}

/* Wrapper pour le bouton desktop et le popup */
.taskbar-desktop-wrapper {
    position: relative;
    flex-shrink: 0;
    /* Permettre au popup de déborder du conteneur */
    overflow: visible;
}

/* ========================================
   ANIMATION PULSE INVITE - Bureau vide
   Grands cercles multicolores sur le fond
   Positionné EN DESSOUS de la taskbar
   Animation économe en ressources (cycle 6s)
   ======================================== */

/* Conteneur des anneaux de pulse - élément séparé, z-index bas */
.desktop-pulse-overlay {
    position: fixed;
    /* Centré verticalement sur la taskbar */
    bottom: calc(var(--taskbar-height, 56px) / 2);
    left: 50%;
    transform: translate(-50%, 50%);
    width: 60px;
    height: 60px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 1; /* En dessous de la taskbar (z-index: 9999) */
}

/* Afficher les anneaux quand l'animation est active */
.desktop-pulse-overlay.pulse-active {
    opacity: 1;
}

/* Anneaux individuels - grands cercles multicolores */
.desktop-pulse-overlay .pulse-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
    will-change: transform, opacity;
    animation: pulseRingLarge 6s ease-out infinite;
}

/* Couleurs différentes pour chaque anneau - palette vibrante */
/* Bordures à 50% d'opacité, ombres inchangées */
.desktop-pulse-overlay .pulse-ring:nth-child(1) {
    border-color: rgba(74, 158, 255, 0.5);
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.4),
                inset 0 0 20px rgba(74, 158, 255, 0.1);
    animation-delay: 0s;
}

.desktop-pulse-overlay .pulse-ring:nth-child(2) {
    border-color: rgba(139, 92, 246, 0.5);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4),
                inset 0 0 20px rgba(139, 92, 246, 0.1);
    animation-delay: 2s;
}

.desktop-pulse-overlay .pulse-ring:nth-child(3) {
    border-color: rgba(236, 72, 153, 0.5);
    box-shadow: 0 0 20px rgba(236, 72, 153, 0.4),
                inset 0 0 20px rgba(236, 72, 153, 0.1);
    animation-delay: 4s;
}

/* Animation keyframes - grands cercles qui s'étendent */
@keyframes pulseRingLarge {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.9;
    }
    100% {
        transform: translate(-50%, -50%) scale(12);
        opacity: 0;
    }
}

/* Mini-grille popup au survol du bouton desktop */
.mini-grid-popup {
    position: fixed;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 
        0 -8px 32px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset,
        var(--shadow-glow);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 10001;
    /* Dimensions calculées dynamiquement par JS */
    overflow: hidden;
    /* Flexbox pour centrer le scaler verticalement */
    display: flex;
    align-items: center;
    justify-content: center;
    /* Background sur le popup pour couvrir toute la surface */
    background: var(--desktop-background);
    /* Animation 3D - effet page de livre qui s'ouvre depuis le fond de l'écran */
    transform-origin: bottom center;
    transform: perspective(1000px) rotateX(15deg) scale(0.95);
    transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Flèche indicatrice */
.mini-grid-popup::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid var(--bg-primary);
}

/* Zone de transition invisible pour garder le popup ouvert pendant le déplacement de la souris */
.mini-grid-popup::before {
    content: '';
    position: absolute;
    bottom: -16px;
    left: -20px;
    right: -20px;
    height: 24px;
}

/* En mode Bureau, le popup s'affiche uniquement au clic (pas de hover) */
.mini-grid-popup.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: perspective(800px) rotateX(0deg) scale(1);
}

/* Force la fermeture immédiate du popup (override les règles hover) */
.mini-grid-popup.force-hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Wrapper pour le scale - ses dimensions correspondent au contenu scalé */
.mini-grid-scaler {
    /* Dimensions définies par JS pour correspondre au container après scale */
    position: relative;
}

/* Container interne - clone exact du desktop mis à l'échelle */
.mini-grid-container {
    /* Mêmes propriétés que .desktop (via variables CSS) - sans background (sur le popup) */
    padding: var(--desktop-padding);
    display: grid;
    grid-template-columns: var(--desktop-grid-columns);
    grid-auto-rows: var(--desktop-icon-height);
    gap: var(--desktop-grid-gap);
    /* Centrage horizontal, alignement en haut (le centrage vertical est géré par le popup) */
    justify-content: center;
    align-content: start;
    /* Dimensions définies par JS */
    /* transform: scale() appliqué par JS */
    transform-origin: top left;
    box-sizing: border-box;
    /* Position absolue pour que le scaler définisse les dimensions visuelles */
    position: absolute;
    top: 0;
    left: 0;
}

/* Cacher les badges dans la mini-grille */
.mini-grid-container .app-icon-badge {
    display: none !important;
}

.taskbar-app {
    height: 44px;
    min-width: 44px;
    padding: 0 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s ease;
    position: relative;
}

.taskbar-app:hover {
    background: rgba(255, 255, 255, 0.1);
}

.taskbar-app.active:hover {
    background: rgba(74, 158, 255, 0.24);
    border-color: rgba(74, 158, 255, 0.5);
}

.taskbar-app.active {
    background: rgba(74, 158, 255, 0.18);
    border-color: rgba(74, 158, 255, 0.4);
    box-shadow: 
        0 0 12px rgba(74, 158, 255, 0.25),
        inset 0 0 8px rgba(74, 158, 255, 0.1);
}

.taskbar-app.active::after {
    content: '';
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
    box-shadow: 0 0 8px rgba(74, 158, 255, 0.6);
}

.taskbar-app.active .taskbar-app-icon {
    box-shadow: 0 0 6px rgba(74, 158, 255, 0.5);
}

.taskbar-app.active .taskbar-app-title {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(74, 158, 255, 0.4);
}

/* Indicateur de lecture média en cours */
.taskbar-app .media-playing-indicator {
    position: absolute;
    top: 6px;
    right: 6px;
    display: none;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    width: 14px;
    height: 12px;
}

.taskbar-app.media-playing .media-playing-indicator {
    display: flex;
}

.media-playing-indicator .bar {
    width: 3px;
    background: #22c55e;
    border-radius: 1px;
    animation: mediaPlayingBars 0.8s ease-in-out infinite;
}

.media-playing-indicator .bar:nth-child(1) {
    height: 40%;
    animation-delay: 0s;
}

.media-playing-indicator .bar:nth-child(2) {
    height: 80%;
    animation-delay: 0.15s;
}

.media-playing-indicator .bar:nth-child(3) {
    height: 60%;
    animation-delay: 0.3s;
}

@keyframes mediaPlayingBars {
    0%, 100% {
        transform: scaleY(0.4);
    }
    50% {
        transform: scaleY(1);
    }
}

/* Version icône desktop aussi */
.app-icon-image .media-playing-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #22c55e;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.5);
}

.app-icon-image .media-playing-badge.visible {
    display: flex;
}

.app-icon-image .media-playing-badge::before {
    content: '';
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 4px 0 4px 6px;
    border-color: transparent transparent transparent white;
    margin-left: 2px;
}

.taskbar-app-icon {
    position: relative;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.taskbar-app-icon svg {
    width: 14px;
    height: 14px;
    stroke: white;
    stroke-width: 1.5;
    fill: none;
}

.taskbar-app-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.taskbar-end {
    display: flex;
    align-items: center;
    gap: 2px; /* Espacement compact, uniforme avec le sidebar */
}

.system-tray {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    transition: background 0.2s ease;
}

.system-tray:hover {
    background: rgba(255, 255, 255, 0.08);
}

.system-tray.active {
    background: rgba(74, 158, 255, 0.15);
}

.system-tray.active svg {
    stroke: var(--accent, #4a9eff);
}

.system-tray svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
    stroke-width: 1.5;
    fill: none;
}

.clock {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Fenêtres d'applications */
.windows-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: var(--taskbar-height);
    pointer-events: none;
    z-index: 1000;
}

.app-window {
    position: absolute;
    background: #000;
    border-radius: 16px 16px 3px 3px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 16px 48px rgba(0, 0, 0, 0.25),
        var(--shadow-glow);
    overflow: hidden;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    min-width: 400px;
    min-height: 300px;
    transform: translateZ(0);
    backface-visibility: hidden;
}

.app-window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
}

/* Mobile fullscreen mode */
.app-window.mobile-fullscreen {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    min-width: unset !important;
    min-height: unset !important;
}

.app-window.mobile-fullscreen .resize-handle {
    display: none !important;
}

.window-header {
    height: 44px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 12px;
    cursor: grab;
    flex-shrink: 0;
}

.window-header:active {
    cursor: grabbing;
}

.window-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.window-title-icon {
    width: 20px;
    height: 20px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window-title-icon svg {
    width: 12px;
    height: 12px;
    stroke: white;
    stroke-width: 1.5;
    fill: none;
}

.window-title-text {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.window-controls {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.window-btn {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.window-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.window-btn.close:hover {
    background: #ef4444;
}

.window-btn svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-secondary);
    stroke-width: 2;
    fill: none;
}

.window-btn:hover svg {
    stroke: white;
}

/* Bouton capture - caché par défaut, affiché si extension disponible */
.window-btn.capture {
    display: none !important;
}

.window-btn.capture.visible {
    display: flex !important;
    background: rgba(74, 158, 255, 0.1);
}

.window-btn.capture:hover {
    background: rgba(74, 158, 255, 0.25);
}

.window-btn.capture svg {
    stroke: #4a9eff;
}

.window-btn.capture:hover svg {
    stroke: #6bb3ff;
}

.window-btn.capture.capturing {
    animation: pulse-capture 0.8s ease-in-out infinite;
}

.window-btn.capture.success {
    background: rgba(34, 197, 94, 0.25);
    animation: flash-success 0.3s ease-out;
}

.window-btn.capture.success svg {
    stroke: #22c55e;
}

.window-btn.capture.error {
    background: rgba(239, 68, 68, 0.25);
    animation: shake-error 0.4s ease-out;
}

.window-btn.capture.error svg {
    stroke: #ef4444;
}

@keyframes pulse-capture {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(0.9); opacity: 0.7; }
}

@keyframes flash-success {
    0% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes shake-error {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

/* Flash de capture d'écran sur le contenu intérieur de la fenêtre */
.app-window.capture-flash .window-content::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    pointer-events: none;
    z-index: 9999;
    animation: windowCaptureFlash 0.3s ease-out forwards;
}

.window-content {
    position: relative;
}

@keyframes windowCaptureFlash {
    0% {
        opacity: 0.9;
    }
    40% {
        opacity: 0.5;
    }
    100% {
        opacity: 0;
    }
}

/* Bouton signaler un bug - Mode debug beta */
.window-btn.bug-report {
    display: none !important;
}

.window-btn.bug-report.visible {
    display: flex !important;
    background: rgba(239, 68, 68, 0.1);
}

.window-btn.bug-report:hover {
    background: rgba(239, 68, 68, 0.25);
}

.window-btn.bug-report svg {
    stroke: #ef4444;
}

.window-btn.bug-report:hover svg {
    stroke: #f87171;
}

/* ==========================================
   BADGE BETA - Fenêtres et Taskbar
   ========================================== */

/* Badge BETA dans la barre de titre des fenêtres */
.window-beta-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: #fcd34d;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(217, 119, 6, 0.4));
    border: 1px solid rgba(245, 158, 11, 0.5);
    border-radius: 12px;
    margin-right: 6px;
    backdrop-filter: blur(10px);
    animation: beta-pulse 2s ease-in-out infinite;
}

@keyframes beta-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Badge BETA dans la taskbar */
.taskbar-beta-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    padding: 1px 4px;
    font-size: 7px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #fcd34d;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.8), rgba(217, 119, 6, 0.8));
    border: 1px solid rgba(245, 158, 11, 0.6);
    border-radius: 3px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    z-index: 10;
    pointer-events: none;
}

/* ==========================================
   MODALE RAPPORT DE BUG - MODE DEBUG BETA
   ========================================== */

.bug-report-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bug-report-modal.visible {
    opacity: 1;
    visibility: visible;
}

.bug-report-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.bug-report-content {
    position: fixed;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    background: linear-gradient(180deg, rgba(25, 25, 35, 0.98) 0%, rgba(18, 18, 26, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 10001;
}

.bug-report-modal.visible .bug-report-content {
    opacity: 1;
    transform: scale(1);
}

.bug-report-content.dragging {
    transition: none;
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.7);
}

.bug-report-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.05) 100%);
    border-bottom: 1px solid rgba(239, 68, 68, 0.2);
    cursor: grab;
    user-select: none;
}

.bug-report-header:active {
    cursor: grabbing;
}

.bug-report-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.3) 0%, rgba(239, 68, 68, 0.1) 100%);
    border-radius: 12px;
    flex-shrink: 0;
}

.bug-report-icon svg {
    width: 28px;
    height: 28px;
    stroke: #ef4444;
}

.bug-report-header-text {
    flex: 1;
}

.bug-report-header-text h2 {
    font-size: 18px;
    font-weight: 600;
    color: #f0f0f5;
    margin: 0 0 4px 0;
}

.bug-report-header-text p {
    font-size: 13px;
    color: #a0aec0;
    margin: 0;
}

.bug-report-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.bug-report-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bug-report-close svg {
    width: 18px;
    height: 18px;
    stroke: #a0aec0;
}

.bug-report-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(90vh - 200px);
}

.bug-report-app-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 10px;
    margin-bottom: 20px;
}

.bug-report-app-label {
    font-size: 13px;
    color: #a0aec0;
}

.bug-report-app-name {
    font-size: 14px;
    font-weight: 600;
    color: #818cf8;
}

.bug-report-screenshot {
    margin-bottom: 20px;
}

.bug-report-screenshot label {
    display: block;
    font-size: 13px;
    color: #a0aec0;
    margin-bottom: 8px;
}

.bug-report-screenshot-preview {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bug-report-screenshot-preview img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

.bug-report-screenshot-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.bug-report-screenshot-remove:hover {
    background: rgba(239, 68, 68, 0.8);
}

.bug-report-screenshot-remove svg {
    width: 16px;
    height: 16px;
    stroke: white;
}

.bug-report-field {
    margin-bottom: 20px;
}

.bug-report-field label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #f0f0f5;
    margin-bottom: 8px;
}

.bug-report-field textarea {
    width: 100%;
    padding: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: #f0f0f5;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s, background-color 0.2s;
}

.bug-report-field textarea:focus {
    outline: none;
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.bug-report-field textarea::placeholder {
    color: #64748b;
}

.bug-report-severity label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #f0f0f5;
    margin-bottom: 12px;
}

.bug-report-severity-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bug-severity-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.bug-severity-option:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.15);
}

.bug-severity-option input {
    display: none;
}

.severity-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.2s;
}

/* Couleurs des points selon la sévérité */
.bug-severity-option[data-severity="blocking"] .severity-indicator {
    background: #ef4444;
}

.bug-severity-option[data-severity="uncomfortable"] .severity-indicator {
    background: #f59e0b;
}

.bug-severity-option[data-severity="minor"] .severity-indicator {
    background: #22c55e;
}

.bug-severity-option span:last-child {
    font-size: 14px;
    color: #a0aec0;
}

/* Style du bouton entier quand sélectionné */
.bug-severity-option:has(input:checked) {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
}

.bug-severity-option:has(input:checked) span:last-child {
    color: #f0f0f5;
}

.bug-severity-option:has(input:checked) .severity-indicator {
    transform: scale(1.2);
    box-shadow: 0 0 8px currentColor;
}

.bug-severity-option[data-severity="blocking"]:has(input:checked) {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(239, 68, 68, 0.1);
}

.bug-severity-option[data-severity="uncomfortable"]:has(input:checked) {
    border-color: rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.1);
}

.bug-severity-option[data-severity="minor"]:has(input:checked) {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.1);
}

.bug-report-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.bug-report-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
}

.bug-report-info svg {
    width: 16px;
    height: 16px;
    stroke: #64748b;
    flex-shrink: 0;
}

.bug-report-actions {
    display: flex;
    gap: 10px;
}

.bug-report-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
}

.bug-report-btn.cancel {
    background: rgba(255, 255, 255, 0.05);
    color: #a0aec0;
}

.bug-report-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f0f0f5;
}

.bug-report-btn.submit {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.bug-report-btn.submit:hover:not(:disabled) {
    background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
    transform: translateY(-1px);
}

.bug-report-btn.submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.bug-report-btn.submit svg {
    width: 16px;
    height: 16px;
}

.bug-report-btn .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modale de succès */
.bug-report-success-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.bug-report-success-modal.visible {
    opacity: 1;
    visibility: visible;
}

.bug-success-content {
    text-align: center;
    padding: 40px 50px;
    background: linear-gradient(180deg, rgba(25, 25, 35, 0.98) 0%, rgba(18, 18, 26, 0.98) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 20px;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bug-report-success-modal.visible .bug-success-content {
    transform: scale(1);
}

.bug-success-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.3) 0%, rgba(34, 197, 94, 0.1) 100%);
    border-radius: 50%;
    animation: success-pulse 0.6s ease-out;
}

@keyframes success-pulse {
    0% { transform: scale(0.5); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.bug-success-icon svg {
    width: 36px;
    height: 36px;
    stroke: #22c55e;
    stroke-width: 2.5;
}

.bug-success-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: #f0f0f5;
    margin: 0 0 8px 0;
}

.bug-success-content p {
    font-size: 14px;
    color: #a0aec0;
    margin: 0;
}

/* Responsive pour la modale bug */
@media (max-width: 600px) {
    .bug-report-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .bug-report-header {
        padding: 16px;
    }
    
    .bug-report-body {
        padding: 16px;
    }
    
    .bug-report-footer {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }
    
    .bug-report-info {
        text-align: center;
    }
    
    .bug-report-actions {
        width: 100%;
    }
    
    .bug-report-btn {
        flex: 1;
    }
}

/* Affichage des dimensions pendant le redimensionnement/déplacement */
.window-resize-dims {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%) scale(0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    height: 24px;
    font-family: 'DM Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    color: #4a9eff;
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.15) 0%, rgba(74, 158, 255, 0.05) 100%);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

/* Animation d'entrée des dimensions */
.window-controls.resizing .window-resize-dims,
.window-controls.dragging .window-resize-dims {
    display: flex;
    opacity: 1;
    animation: dims-slide-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes dims-slide-in {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* Cacher les boutons ET le badge BETA pendant le redimensionnement/déplacement avec animation */
.window-controls.resizing .window-btn,
.window-controls.resizing .window-beta-badge,
.window-controls.dragging .window-btn,
.window-controls.dragging .window-beta-badge {
    animation: btns-fade-out 0.25s ease forwards;
    pointer-events: none;
}

@keyframes btns-fade-out {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0.7);
        width: 0;
        padding: 0;
        margin: 0;
        overflow: hidden;
    }
}

/* Animation de retour des boutons ET du badge BETA (seulement après avoir été en mode resizing/dragging) */
.window-controls.was-resizing .window-btn,
.window-controls.was-resizing .window-beta-badge,
.window-controls.was-dragging .window-btn,
.window-controls.was-dragging .window-beta-badge {
    animation: btns-fade-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes btns-fade-in {
    0% {
        opacity: 0;
        transform: scale(0.7);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation de sortie des dimensions */
.window-controls.was-resizing:not(.resizing) .window-resize-dims,
.window-controls.was-dragging:not(.dragging) .window-resize-dims {
    animation: dims-slide-out 0.2s ease forwards;
}

@keyframes dims-slide-out {
    0% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
}

.window-content {
    flex: 1;
    overflow: hidden;
    background: #000;
}

.window-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
}

/* Resize handles */
.resize-handle {
    position: absolute;
    z-index: 10;
}

.resize-handle.n { top: 0; left: 10px; right: 10px; height: 4px; cursor: n-resize; }
.resize-handle.s { bottom: 0; left: 10px; right: 10px; height: 4px; cursor: s-resize; }
.resize-handle.e { right: 0; top: 10px; bottom: 10px; width: 4px; cursor: e-resize; }
.resize-handle.w { left: 0; top: 10px; bottom: 10px; width: 4px; cursor: w-resize; }
.resize-handle.ne { top: 0; right: 0; width: 10px; height: 10px; cursor: ne-resize; }
.resize-handle.nw { top: 0; left: 0; width: 10px; height: 10px; cursor: nw-resize; }
.resize-handle.se { bottom: 0; right: 0; width: 10px; height: 10px; cursor: se-resize; }
.resize-handle.sw { bottom: 0; left: 0; width: 10px; height: 10px; cursor: sw-resize; }

/* Animations */
@keyframes windowOpen {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.app-window {
    animation: windowOpen 0.2s ease-out;
}

/* Désactiver l'animation d'ouverture */
.app-window.no-open-animation {
    animation: none;
}

/* Fenêtre active (focus) - liseré bleu */
.app-window.focused {
    box-shadow: 
        0 0 0 2px rgba(74, 158, 255, 0.7),
        0 0 12px rgba(74, 158, 255, 0.25),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.3),
        0 16px 48px rgba(0, 0, 0, 0.25);
}

/* Fenêtre en cours de déplacement - liseré épais bleu */
.app-window.dragging {
    box-shadow: 
        0 0 0 3px rgba(74, 158, 255, 0.9),
        0 0 20px rgba(74, 158, 255, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 16px 64px rgba(0, 0, 0, 0.4);
    transition: box-shadow 0.15s ease;
}

/* Fenêtre en preview (hover dans menu multi-fenêtres) - 50% moins intense que focus */
.app-window.preview-highlight {
    box-shadow: 
        0 0 0 2px rgba(74, 158, 255, 0.35),
        0 0 8px rgba(74, 158, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Logo sys.quebec */
.sys-logo {
    position: absolute;
    bottom: 80px;
    right: 32px;
    opacity: 0.15;
    pointer-events: none;
}

.sys-logo-text {
    font-size: 48px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Scrollbar personnalisé */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary, #161b22);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.3));
    border: 2px solid var(--bg-secondary, #161b22);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.2));
}

::-webkit-scrollbar-corner {
    background: var(--bg-secondary, #161b22);
}

/* Supprimer TOUTES les flèches de scrollbar */
::-webkit-scrollbar-button {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
    background-color: transparent !important;
}

::-webkit-scrollbar-button:single-button {
    display: none !important;
    background: transparent !important;
}

::-webkit-scrollbar-button:single-button:vertical:decrement,
::-webkit-scrollbar-button:single-button:vertical:increment,
::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment,
::-webkit-scrollbar-button:vertical:start:decrement,
::-webkit-scrollbar-button:vertical:end:increment,
::-webkit-scrollbar-button:vertical:start:increment,
::-webkit-scrollbar-button:vertical:end:decrement {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    background: none !important;
}

/* ===== Notifications ===== */
.notification-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.notification-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.notification-btn.active {
    background: rgba(74, 158, 255, 0.15);
}

.notification-btn.active svg {
    stroke: var(--accent, #4a9eff);
}

.notification-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.2s ease;
}

.notification-btn:hover svg {
    stroke: var(--text-primary);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.2s ease;
}

.notification-badge.visible {
    opacity: 1;
    transform: scale(1);
}

/* Panel de notifications */
.notification-panel {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 12px);
    right: 16px; /* Au-dessus de l'icône notification (à droite) */
    width: 380px;
    max-height: 500px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: panelOpen 0.2s ease-out;
}

.notification-panel.open {
    display: flex;
}

@keyframes panelOpen {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notification-panel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.notification-panel-actions {
    display: flex;
    gap: 8px;
}

.notification-action-btn {
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    color: var(--text-secondary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.notification-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Option notifications Chrome */
.notification-chrome-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: rgba(74, 158, 255, 0.05);
    border-bottom: 1px solid var(--border-color);
}

.notification-chrome-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.notification-chrome-icon {
    width: 20px;
    height: 20px;
    stroke: var(--accent-blue);
    stroke-width: 1.5;
    fill: none;
}

.notification-chrome-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification-chrome-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.notification-chrome-status {
    font-size: 11px;
    color: var(--text-secondary);
}

.notification-chrome-status.granted {
    color: #22c55e;
}

.notification-chrome-status.denied {
    color: #ef4444;
}

.notification-chrome-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.notification-chrome-toggle .toggle-label-off,
.notification-chrome-toggle .toggle-label-on {
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.notification-chrome-toggle .toggle-label-off {
    color: var(--text-secondary);
}

.notification-chrome-toggle .toggle-label-on {
    color: var(--text-secondary);
}

.notification-chrome-toggle .toggle-switch {
    width: 40px;
    height: 22px;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    transition: all 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification-chrome-toggle .toggle-knob {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--text-secondary);
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* État actif */
.notification-chrome-toggle[data-state="active"] .toggle-switch {
    background: rgba(34, 197, 94, 0.3);
    border-color: #22c55e;
}

.notification-chrome-toggle[data-state="active"] .toggle-knob {
    left: 20px;
    background: #22c55e;
}

.notification-chrome-toggle[data-state="active"] .toggle-label-on {
    color: #22c55e;
}

.notification-chrome-toggle[data-state="active"]:hover .toggle-switch {
    background: rgba(34, 197, 94, 0.4);
}

/* État inactif (granted mais désactivé par l'utilisateur) */
.notification-chrome-toggle[data-state="inactive"] .toggle-switch {
    background: rgba(255, 255, 255, 0.08);
}

.notification-chrome-toggle[data-state="inactive"] .toggle-knob {
    left: 2px;
    background: var(--text-secondary);
}

.notification-chrome-toggle[data-state="inactive"] .toggle-label-off {
    color: var(--text-primary);
}

.notification-chrome-toggle[data-state="inactive"]:hover .toggle-switch {
    background: rgba(255, 255, 255, 0.12);
}

/* État default - permission pas encore demandée */
.notification-chrome-toggle[data-state="default"] .toggle-switch {
    background: rgba(74, 158, 255, 0.2);
    border-color: var(--accent-blue);
    animation: pulse-blue 2s infinite;
}

.notification-chrome-toggle[data-state="default"] .toggle-knob {
    background: var(--accent-blue);
}

@keyframes pulse-blue {
    0%, 100% { box-shadow: 0 0 0 0 rgba(74, 158, 255, 0.4); }
    50% { box-shadow: 0 0 0 4px rgba(74, 158, 255, 0); }
}

/* État denied - bloqué par le navigateur */
.notification-chrome-toggle[data-state="denied"] .toggle-switch {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.5);
}

.notification-chrome-toggle[data-state="denied"] .toggle-knob {
    background: #ef4444;
}

.notification-chrome-toggle[data-state="denied"] .toggle-label-off {
    color: #ef4444;
}

.notification-chrome-toggle[data-state="denied"]:hover .toggle-switch {
    background: rgba(239, 68, 68, 0.25);
}

/* État unsupported */
.notification-chrome-toggle[data-state="unsupported"] {
    cursor: default;
    opacity: 0.5;
}

.notification-chrome-toggle[data-state="unsupported"] .toggle-switch {
    background: rgba(255, 255, 255, 0.05);
}

.notification-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.notification-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
}

.notification-empty svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-secondary);
    stroke-width: 1;
    fill: none;
    opacity: 0.5;
    margin-bottom: 12px;
}

/* Item de notification */
.notification-item {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.notification-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.notification-item.clickable {
    cursor: pointer;
}

.notification-item.clickable:hover {
    background: rgba(74, 158, 255, 0.1);
}

.notification-item.unread {
    background: rgba(74, 158, 255, 0.08);
    border-left: 3px solid var(--accent-blue);
}

.notification-item.unread:hover {
    background: rgba(74, 158, 255, 0.12);
}

.notification-item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 6px;
}

.notification-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.notification-item-icon svg {
    width: 16px;
    height: 16px;
    stroke: white;
    stroke-width: 1.5;
    fill: none;
}

.notification-item-content {
    flex: 1;
    min-width: 0;
}

.notification-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.notification-item-message {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.notification-item-time {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.notification-item-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.notification-item:hover .notification-item-actions {
    opacity: 1;
}

.notification-item-btn {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.notification-item-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.notification-item-btn.delete:hover {
    background: rgba(239, 68, 68, 0.3);
}

.notification-item-btn svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-secondary);
    stroke-width: 2;
    fill: none;
}

.notification-item-btn:hover svg {
    stroke: white;
}

/* ============================
   OS DIALOG SYSTEM
   ============================ */

/* Variables par défaut pour les dialogues (peuvent être surchargées par l'app) */
.os-dialog {
    --dialog-accent: #4a9eff;
    --dialog-accent-light: #6bb3ff;
    --dialog-accent-dark: #3584e4;
}

/* Overlay sur la fenêtre appelante uniquement */
.os-dialog-app-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 100;
    border-radius: inherit;
    pointer-events: all;
}

/* Fenêtre d'app avec dialogue actif */
.app-window.has-dialog {
    pointer-events: none;
}

.app-window.has-dialog .window-header {
    pointer-events: auto;
}

.app-window.has-dialog .window-content {
    opacity: 0.65;
}

/* Dialogue au niveau OS */
.os-dialog {
    position: fixed;
    min-width: 360px;
    max-width: 90vw;
    max-height: 80vh;
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 
        0 30px 100px rgba(0, 0, 0, 0.8),
        0 15px 50px rgba(0, 0, 0, 0.6),
        0 5px 20px rgba(0, 0, 0, 0.4),
        0 0 1px rgba(255, 255, 255, 0.1);
    z-index: 5000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform: translateZ(0);
}

.os-dialog.active {
    display: flex;
}

.os-dialog-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    cursor: grab;
    user-select: none;
}

.os-dialog-header:active {
    cursor: grabbing;
}

.os-dialog-title {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--dialog-accent-light);
}

.os-dialog-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.os-dialog-close:hover {
    background: rgba(239, 68, 68, 0.2);
}

.os-dialog-close svg {
    width: 16px;
    height: 16px;
    stroke: var(--text-secondary);
    stroke-width: 2;
    fill: none;
}

.os-dialog-close:hover svg {
    stroke: #ef4444;
}

.os-dialog-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    color: var(--text-primary);
}

.os-dialog-message {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.os-dialog-form-group {
    margin-bottom: 16px;
}

.os-dialog-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.os-dialog-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
    transition: all 0.2s ease;
}

.os-dialog-input:focus {
    outline: none;
    border-color: var(--dialog-accent);
    background: color-mix(in srgb, var(--dialog-accent) 5%, transparent);
}

.os-dialog-input::placeholder {
    color: var(--text-secondary);
}

.os-dialog-select-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
}

.os-dialog-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: all 0.15s ease;
    border-bottom: 1px solid var(--border-color);
}

.os-dialog-select-item:last-child {
    border-bottom: none;
}

.os-dialog-select-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.os-dialog-select-item.selected {
    background: color-mix(in srgb, var(--dialog-accent) 15%, transparent);
}

.os-dialog-checkbox {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.os-dialog-select-item.selected .os-dialog-checkbox {
    background: var(--dialog-accent);
    border-color: var(--dialog-accent);
}

.os-dialog-checkbox svg {
    width: 12px;
    height: 12px;
    stroke: white;
    stroke-width: 3;
    fill: none;
    opacity: 0;
}

.os-dialog-select-item.selected .os-dialog-checkbox svg {
    opacity: 1;
}

.os-dialog-select-avatar {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--dialog-accent) 15%, var(--bg-tertiary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
    color: var(--dialog-accent-light);
    flex-shrink: 0;
}

.os-dialog-select-info {
    flex: 1;
    min-width: 0;
}

.os-dialog-select-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-dialog-select-sub {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.os-dialog-empty {
    padding: 30px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.os-dialog-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 14px 20px;
    background: var(--bg-tertiary);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.os-dialog-btn {
    padding: 10px 20px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.os-dialog-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.os-dialog-btn.primary {
    background: linear-gradient(135deg, var(--dialog-accent), var(--dialog-accent-dark));
    border: none;
    color: white;
}

.os-dialog-btn.primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.os-dialog-btn.danger {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.os-dialog-btn.danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* ============================
   NETWORK STATUS ICON
   ============================ */

.system-tray .network-icon {
    transition: stroke 0.2s ease, filter 0.2s ease;
}

.system-tray .network-icon.ping-success {
    stroke: #22c55e !important;
    filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.6));
}

.system-tray .network-icon-offline {
    stroke: #ef4444 !important;
}

/* ============================
   SYSTEM PANEL (Refresh/Fullscreen)
   ============================ */

.system-panel {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 12px);
    right: 16px;
    width: 300px;
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: panelOpen 0.2s ease-out;
}

.system-panel.open {
    display: flex;
}

.system-panel-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.system-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.system-panel-body {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.system-panel-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s ease;
    text-align: left;
}

.system-panel-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.system-panel-btn:active {
    transform: scale(0.98);
}

.system-panel-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent-blue);
    stroke-width: 1.5;
    fill: none;
    flex-shrink: 0;
}

.system-panel-footer {
    padding: 10px 16px;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
}

.system-panel-status {
    display: flex;
    align-items: center;
    justify-content: center;
}

.connection-status {
    font-size: 11px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.connection-status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
}

.connection-status.connected::before {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.connection-status.connected {
    color: #22c55e;
}

.connection-status.disconnected {
    color: #ef4444;
}

.connection-status.disconnected::before {
    background: #ef4444;
}

/* System Panel - Options avec toggle */
.system-panel-separator {
    height: 1px;
    background: var(--border-color);
    margin: 6px 0;
}

.system-panel-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.15s ease;
}

.system-panel-option:hover {
    background: rgba(255, 255, 255, 0.06);
}

.system-panel-option-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.system-panel-option-icon {
    width: 18px;
    height: 18px;
    stroke: var(--accent-blue);
    stroke-width: 1.5;
    fill: none;
    flex-shrink: 0;
}

.system-panel-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.system-panel-option-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.system-panel-option-status {
    font-size: 10px;
    color: var(--text-secondary);
}

.system-panel-option-status.active {
    color: #22c55e;
}

/* System Panel Toggle Switch */
.system-panel-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.system-panel-toggle .toggle-switch {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    position: relative;
    transition: all 0.2s ease;
}

.system-panel-toggle .toggle-knob {
    position: absolute;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.system-panel-toggle .toggle-label-off,
.system-panel-toggle .toggle-label-on {
    display: none;
    transition: opacity 0.2s;
}

.system-panel-toggle[data-state="inactive"] .toggle-label-off {
    opacity: 1;
    color: var(--text-secondary);
}

.system-panel-toggle[data-state="active"] .toggle-label-on {
    opacity: 1;
    color: #22c55e;
}

.system-panel-toggle[data-state="active"] .toggle-switch {
    background: #22c55e;
}

.system-panel-toggle[data-state="active"] .toggle-knob {
    transform: translateX(16px);
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

/* Voyant d'extension dans le header */
.extension-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.extension-indicator:hover {
    background: rgba(255, 255, 255, 0.1);
}

.extension-indicator .extension-icon {
    width: 16px;
    height: 16px;
    stroke-width: 1.5;
    fill: none;
}

.extension-indicator .extension-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
}

/* État inactif (rouge) */
.extension-indicator.inactive .extension-icon {
    stroke: #ef4444;
}

.extension-indicator.inactive .extension-dot {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

/* État actif (vert) */
.extension-indicator.active .extension-icon {
    stroke: #22c55e;
}

.extension-indicator.active .extension-dot {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

/* ============================
   ACCOUNT PANEL (Popup Identité)
   ============================ */

.account-btn {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.account-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.account-btn.active {
    background: rgba(74, 158, 255, 0.15);
}

.account-btn.active svg {
    stroke: var(--accent, #4a9eff);
}

.account-btn svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-secondary);
    stroke-width: 1.5;
    fill: none;
    transition: stroke 0.2s ease;
}

.account-btn:hover svg {
    stroke: var(--text-primary);
}

.account-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 16px;
    height: 16px;
    background: #ef4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.account-panel {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 12px);
    right: 100px;
    width: 320px;
    max-height: 480px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    z-index: 10001;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: panelOpen 0.2s ease-out;
}

.account-panel.open {
    display: flex;
}

.account-panel-header {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Zones cliquables dans le panel compte */
.account-zone {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s ease;
    user-select: none;
}

.account-zone:hover {
    background: rgba(255, 255, 255, 0.08);
}

.account-zone:active {
    background: rgba(255, 255, 255, 0.12);
}

/* Zone profil utilisateur */
.account-zone-profile {
    /* Hérite de .account-zone */
}

/* Zone entreprise */
.account-zone-entreprise {
    /* Même style que la zone profil, juste séparée visuellement */
}

/* Icône de l'entreprise (même taille que l'avatar utilisateur) */
.entreprise-icon {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--entreprise-color, #059669);
    transition: background 0.2s;
}

.entreprise-icon svg {
    width: 28px;
    height: 28px;
    stroke: white;
    fill: none;
}

.account-zone-entreprise span {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* L'avatar du panel compte utilise maintenant .user-avatar avec data-size="lg" */
/* Voir /ux/user-avatar.css pour les styles */

.account-panel-info {
    flex: 1;
    min-width: 0;
}

.account-panel-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-panel-email {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.account-panel-entreprise {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    font-size: 11px;
    color: #0ea5e9;
    cursor: pointer;
    transition: opacity 0.15s;
}

.account-panel-entreprise:hover {
    opacity: 0.8;
}

.account-panel-entreprise svg {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}

.account-panel-entreprise span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-section {
    padding: 12px;
}

.account-anonymous-text {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
    text-align: center;
    line-height: 1.5;
}

.account-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.account-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.account-action-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent-blue);
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.account-action-btn.account-action-primary {
    background: #8b5cf6;
    border-color: transparent;
}

.account-action-btn.account-action-primary:hover {
    background: #9d6eff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.35);
}

.account-action-btn.account-action-primary svg {
    stroke: white;
}

.account-action-btn.account-action-danger {
    color: #ef4444;
}

.account-action-btn.account-action-danger svg {
    stroke: #ef4444;
}

.account-action-btn.account-action-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

.account-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.account-qr-section {
    padding: 0 12px 8px;
}

/* Section Comptes récents (switch rapide) */
.account-recent-section {
    padding: 0 12px 8px;
}

.account-recent-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.account-recent-header > svg {
    width: 16px;
    height: 16px;
    color: #8b5cf6;
}

.account-recent-header > span {
    flex: 1;
}

.account-recent-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.account-recent-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-user-select: none;
    user-select: none;
}

.account-recent-item:hover {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.account-recent-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #6b7280; /* Couleur par défaut grise, remplacée par style inline si couleur personnalisée */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.account-recent-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
    flex: 1;
}

.account-recent-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-recent-email {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-recent-remove {
    width: 20px;
    height: 20px;
    padding: 0;
    border: none;
    background: transparent;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    flex-shrink: 0;
}

.account-recent-item:hover .account-recent-remove {
    opacity: 0.6;
}

.account-recent-remove:hover {
    opacity: 1 !important;
    background: rgba(239, 68, 68, 0.2);
}

.account-recent-remove svg {
    width: 14px;
    height: 14px;
    stroke: #ef4444;
}

/* Les styles du bouton engrenage ont été supprimés - 
   Le profil s'ouvre maintenant en cliquant directement sur la zone profil */

.account-requests-section {
    margin-bottom: 8px;
    border-radius: 10px;
    background: rgba(74, 158, 255, 0.1);
    border: 1px solid rgba(74, 158, 255, 0.2);
    overflow: hidden;
}

.account-requests-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.account-requests-header svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent-blue);
    stroke-width: 2;
    fill: none;
}

.account-requests-count {
    margin-left: auto;
    background: var(--accent-blue);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 10px;
}

.account-requests-list {
    max-height: 200px;
    overflow-y: auto;
}

.account-request-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.15s ease;
}

.account-request-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.account-request-visual {
    display: grid;
    grid-template-columns: repeat(3, 18px);
    gap: 2px;
}

.account-request-visual-cell {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.account-request-info {
    flex: 1;
    min-width: 0;
}

.account-request-app {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.account-request-device {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-request-actions {
    display: flex;
    gap: 4px;
}

.account-request-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.account-request-btn svg {
    width: 14px;
    height: 14px;
    stroke-width: 2.5;
    fill: none;
}

.account-request-btn.approve {
    background: #22c55e;
    color: white;
}

.account-request-btn.approve:hover {
    background: #16a34a;
}

.account-request-btn.approve svg {
    stroke: white;
}

.account-request-btn.deny {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.account-request-btn.deny:hover {
    background: #ef4444;
    color: white;
}

.account-request-btn.deny svg {
    stroke: currentColor;
}

/* Responsive account panel */
@media (max-width: 768px) {
    .account-panel {
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
        bottom: 60px;
    }
}

/* ============================
   RESPONSIVE / MOBILE
   ============================ */

/* Variable pour le breakpoint mobile */
:root {
    --mobile-breakpoint: 768px;
}

/* ========== TABLET (max-width: 768px) ========== */
@media (max-width: 768px) {
    /* Cacher la mini-grille popup sur tablettes et mobiles */
    .mini-grid-popup {
        display: none !important;
    }
    
    /* Desktop: grille adaptée pour tablette */
    .desktop {
        padding: 20px;
        grid-template-columns: repeat(auto-fill, 85px);
        grid-template-rows: repeat(auto-fill, 100px);
        gap: 12px;
    }
    
    /* Icônes légèrement plus petites */
    .app-icon-image {
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }
    
    .app-icon-image svg {
        width: 24px;
        height: 24px;
    }
    
    .app-icon-label {
        font-size: 11px;
        max-width: 80px;
    }
    
    /* Logo discret sur mobile */
    .sys-logo {
        display: none;
    }
    
    /* Fenêtres: forcer plein écran par défaut (sauf popups) */
    .app-window:not(.popup-window) {
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        min-width: unset !important;
        min-height: unset !important;
    }
    
    /* Cacher les poignées de resize sur mobile */
    .app-window .resize-handle {
        display: none !important;
    }
    
    /* Barre de fenêtre adaptée mobile */
    .window-header {
        height: 48px;
        padding: 0 8px;
    }
    
    /* Cacher les boutons minimize/maximize sur mobile */
    .window-btn.minimize,
    .window-btn.maximize {
        display: none;
    }
    
    /* Bouton close plus grand et visible */
    .window-btn.close {
        width: 36px;
        height: 36px;
    }
    
    /* Taskbar adaptée */
    .taskbar {
        padding: 0 8px;
        height: 52px;
    }
    
    .taskbar-apps {
        gap: 2px;
        padding: 0 8px;
    }
    
    /* Bouton desktop plus petit */
    .taskbar-desktop-btn {
        height: 40px;
        min-width: 40px;
        padding: 0 10px;
    }
    
    .taskbar-desktop-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* Taskbar items: afficher uniquement l'icône */
    .taskbar-app {
        padding: 0 10px;
        height: 40px;
        min-width: 40px;
    }
    
    .taskbar-app-title {
        display: none;
    }
    
    /* System tray compact */
    .system-tray {
        padding: 6px 10px;
        gap: 6px;
    }
    
    /* Panel notifications responsive */
    .notification-panel {
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
        bottom: 60px;
    }
    
    /* System panel responsive */
    .system-panel {
        right: 8px;
        left: 8px;
        width: auto;
        max-width: none;
        bottom: 60px;
    }
}

/* ========== MOBILE (max-width: 480px) ========== */
@media (max-width: 480px) {
    /* Desktop: grille compacte */
    .desktop {
        padding: 16px;
        grid-template-columns: repeat(auto-fill, 75px);
        grid-template-rows: repeat(auto-fill, 90px);
        gap: 8px;
    }
    
    /* Icônes encore plus compactes */
    .app-icon {
        padding: 8px 4px;
    }
    
    .app-icon-image {
        width: 46px;
        height: 46px;
        margin-bottom: 6px;
    }
    
    .app-icon-image svg {
        width: 22px;
        height: 22px;
    }
    
    .app-icon-label {
        font-size: 10px;
        max-width: 70px;
    }
    
    /* Barre de titre encore plus compacte */
    .window-header {
        height: 44px;
    }
    
    .window-title-text {
        font-size: 12px;
        max-width: 150px;
    }
    
    /* Taskbar mobile */
    .taskbar {
        height: 48px;
        padding: 0 6px;
    }
    
    .taskbar-app {
        height: 36px;
        min-width: 36px;
        padding: 0 8px;
    }
    
    .taskbar-app-icon {
        width: 22px;
        height: 22px;
    }
    
    .taskbar-app-icon svg {
        width: 12px;
        height: 12px;
    }
    
    /* Bouton desktop mobile */
    .taskbar-desktop-btn {
        height: 36px;
        min-width: 36px;
        padding: 0 8px;
    }
    
    .taskbar-desktop-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Horloge compacte */
    .clock {
        font-size: 12px;
    }
    
    /* Notification badge */
    .notification-btn {
        width: 32px;
        height: 32px;
    }
    
    .notification-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* ========== LANDSCAPE MOBILE ========== */
@media (max-width: 768px) and (orientation: landscape) {
    .desktop {
        grid-template-columns: repeat(auto-fill, 80px);
        grid-template-rows: repeat(auto-fill, 85px);
        padding: 12px 20px;
    }
    
    /* Taskbar latérale en landscape pourrait être une option future */
}

/* ========== TOUCH IMPROVEMENTS ========== */
@media (hover: none) and (pointer: coarse) {
    /* Supprimer les effets hover sur devices tactiles */
    .app-icon:hover {
        background: transparent;
        transform: none;
    }
    
    .app-icon:active {
        background: rgba(255, 255, 255, 0.1);
        transform: scale(0.95);
    }
    
    .taskbar-app:hover {
        background: rgba(255, 255, 255, 0.06);
    }
    
    .taskbar-app:active {
        background: rgba(255, 255, 255, 0.12);
    }
    
    /* Zones de touch plus grandes */
    .window-btn {
        min-width: 36px;
        min-height: 36px;
    }
}

/* ========== SAFE AREA (iPhone Notch, etc.) ========== */
@supports (padding: max(0px)) {
    .taskbar {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
        padding-left: max(8px, env(safe-area-inset-left));
        padding-right: max(8px, env(safe-area-inset-right));
    }
    
    .desktop {
        padding-top: max(20px, env(safe-area-inset-top));
    }
}

/* ========== EXTENSION ASSISTANT MODAL ========== */
.extension-assistant-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.extension-assistant-modal.visible {
    opacity: 1;
}

.extension-assistant-modal .assistant-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.extension-assistant-modal .assistant-dialog {
    position: relative;
    background: linear-gradient(165deg, #1a1a25 0%, #12121a 100%);
    border: 1px solid rgba(74, 158, 255, 0.3);
    border-radius: 16px;
    max-width: 520px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 
        0 24px 48px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(74, 158, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.extension-assistant-modal.visible .assistant-dialog {
    transform: translateY(0);
}

.extension-assistant-modal .assistant-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 1;
}

.extension-assistant-modal .assistant-close svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-secondary);
}

.extension-assistant-modal .assistant-close:hover {
    background: rgba(239, 68, 68, 0.2);
}

.extension-assistant-modal .assistant-close:hover svg {
    stroke: #ef4444;
}

.extension-assistant-modal .assistant-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.extension-assistant-modal .assistant-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.extension-assistant-modal .assistant-icon.info {
    background: linear-gradient(135deg, rgba(74, 158, 255, 0.2), rgba(74, 158, 255, 0.1));
    color: #4a9eff;
}

.extension-assistant-modal .assistant-icon.warning {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.1));
    color: #fbbf24;
}

.extension-assistant-modal .assistant-icon.success {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    color: #22c55e;
}

.extension-assistant-modal .assistant-icon svg {
    width: 28px;
    height: 28px;
    stroke: currentColor;
}

.extension-assistant-modal .assistant-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.extension-assistant-modal .assistant-body {
    padding: 20px 24px 24px;
}

.extension-assistant-modal .assistant-body p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.extension-assistant-modal .error-detail {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #fca5a5;
    font-family: 'DM Mono', monospace;
}

.extension-assistant-modal .assistant-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 20px 0;
}

.extension-assistant-modal .assistant-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}

.extension-assistant-modal .step-num {
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
}

.extension-assistant-modal .step-content {
    flex: 1;
}

.extension-assistant-modal .step-content strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.extension-assistant-modal .step-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 6px;
    margin-bottom: 0;
}

.extension-assistant-modal .btn-assistant-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.extension-assistant-modal .btn-assistant-action svg {
    width: 16px;
    height: 16px;
}

.extension-assistant-modal .btn-assistant-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 158, 255, 0.3);
}

.extension-assistant-modal .btn-assistant-action.secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.extension-assistant-modal .btn-assistant-action.secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: none;
}

.extension-assistant-modal .assistant-alt {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.extension-assistant-modal .assistant-alt p {
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.extension-assistant-modal .assistant-alt ul {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}

.extension-assistant-modal .assistant-alt li {
    position: relative;
    padding-left: 16px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 6px;
}

.extension-assistant-modal .assistant-alt li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--accent-blue);
}

.extension-assistant-modal .capture-preview {
    text-align: center;
    margin: 16px 0;
}

/* Scrollbar pour le modal */
.extension-assistant-modal .assistant-dialog::-webkit-scrollbar {
    width: 8px;
}

.extension-assistant-modal .assistant-dialog::-webkit-scrollbar-track {
    background: transparent;
}

.extension-assistant-modal .assistant-dialog::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 0;
}

/* ============================================
   MENU CONTEXTUEL DE LA TASKBAR
   ============================================ */

.taskbar-context-menu {
    animation: taskbarContextMenuFadeIn 0.15s ease;
}

.taskbar-context-menu .context-menu-item:first-child {
    border-radius: 6px 6px 0 0;
}

.taskbar-context-menu .context-menu-item:last-child {
    border-radius: 0 0 6px 6px;
}

.taskbar-context-menu .context-menu-item:only-child {
    border-radius: 6px;
}

@keyframes taskbarContextMenuFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(5px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========================================
   POPUP WINDOWS
   ======================================== */

.app-window.popup-window {
    border-radius: 12px;
    min-width: unset;
    min-height: unset;
    background: #12121a;
    border: 1px solid rgba(139, 92, 246, 0.4);
    animation: popupFadeIn 0.18s ease-out;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.5),
        0 16px 64px rgba(139, 92, 246, 0.12);
    overflow: hidden;
    padding: 0;
    /* Transition pour forcer le repaint du layer GPU lors des redimensionnements */
    transition: width 0.1s ease-out, height 0.1s ease-out;
}

.app-window.popup-window .window-content {
    border-radius: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background: #12121a;
    padding: 0;
    margin: 0;
}

.app-window.popup-window .window-content iframe {
    width: 100%;
    height: 100%;
    border: none;
    margin: 0;
    padding: 0;
    background: #12121a;
    display: block;
    border-radius: 0;
}

.app-window.popup-window .resize-handle {
    display: none !important;
}

@keyframes popupFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ========================================
   AUTH PANEL (Connexion intégrée)
   ======================================== */

.auth-panel {
    position: fixed;
    bottom: calc(var(--taskbar-height) + 12px);
    right: 60px;
    width: 320px;
    background: #12121a;
    border-radius: 16px;
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 
        0 25px 80px rgba(0, 0, 0, 0.6),
        0 16px 64px rgba(139, 92, 246, 0.15);
    z-index: 10000;
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: panelOpen 0.2s ease-out;
}

.auth-panel.open {
    display: flex;
}

.auth-panel-header {
    padding: 16px 20px 12px;
    text-align: center;
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.auth-panel-title {
    font-size: 22px;
    font-weight: 700;
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-panel-subtitle {
    display: block;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.auth-panel-body {
    padding: 16px 20px 20px;
}

/* Auth Steps */
.auth-step {
    display: none;
}

.auth-step.active {
    display: block;
}

.auth-step-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
    text-align: center;
}

.auth-step-desc {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 16px;
    line-height: 1.4;
}

.auth-step-desc strong {
    color: var(--text-primary);
}

/* Auth Messages */
.auth-message {
    display: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 12px;
    margin-bottom: 12px;
}

.auth-message.error {
    display: block;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.auth-message.success {
    display: block;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #6ee7b7;
}

/* Auth Form */
.auth-form-group {
    margin-bottom: 12px;
}

.auth-form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.auth-form-input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

.auth-form-input:focus {
    outline: none;
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.auth-form-input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

/* Auth Buttons */
.auth-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    user-select: none;
}

.auth-btn-primary {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
}

.auth-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

.auth-btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
    box-shadow: none;
}

/* Saved Accounts */
.auth-saved-accounts {
    margin-bottom: 12px;
}

.auth-saved-accounts:empty {
    display: none;
}

.auth-account-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(139, 92, 246, 0.12);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.auth-account-item:hover {
    background: rgba(139, 92, 246, 0.22);
    border-color: #a78bfa;
    transform: translateX(2px);
}

.auth-account-item:last-child {
    margin-bottom: 0;
}

.auth-account-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: white;
    flex-shrink: 0;
}

.auth-account-info {
    flex: 1;
    min-width: 0;
}

.auth-account-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-account-email {
    font-size: 11px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 1px;
}

.auth-account-hint {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 1px;
}

.auth-account-remove {
    color: var(--text-secondary);
    font-size: 16px;
    padding: 4px 6px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.2s;
    flex-shrink: 0;
}

.auth-account-remove:hover {
    color: #ef4444;
    opacity: 1;
}

/* Auth Links */
.auth-other-link,
.auth-back-link {
    text-align: center;
    margin-top: 14px;
    font-size: 12px;
}

.auth-other-link a,
.auth-back-link a {
    color: #a78bfa;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-other-link a:hover,
.auth-back-link a:hover {
    color: #c4b5fd;
}

.auth-link-sep {
    color: var(--text-secondary);
    margin: 0 6px;
}

/* Verification Options */
.auth-verification-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.auth-verification-option {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    font-family: inherit;
    color: var(--text-primary);
}

.auth-verification-option:hover {
    border-color: #8b5cf6;
    background: rgba(139, 92, 246, 0.18);
}

.auth-opt-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    flex-shrink: 0;
    stroke: #a78bfa;
    stroke-width: 1.5;
    fill: none;
}

.auth-opt-content {
    flex: 1;
    min-width: 0;
}

.auth-opt-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.auth-opt-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.auth-opt-badge {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 8px;
    white-space: nowrap;
}

/* Visual Key */
.auth-visual-key-container {
    text-align: center;
    padding: 12px 0;
}

.auth-visual-key-grid {
    display: inline-grid;
    grid-template-columns: repeat(3, 40px);
    gap: 4px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    border: 2px solid rgba(139, 92, 246, 0.3);
}

.auth-visual-cell {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.auth-visual-code {
    font-family: monospace;
    font-size: 16px;
    color: var(--text-secondary);
    letter-spacing: 3px;
    margin-top: 10px;
}

/* Waiting Animation */
.auth-waiting-dots {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin: 16px 0;
}

.auth-dot {
    width: 10px;
    height: 10px;
    background: #8b5cf6;
    border-radius: 50%;
    animation: authDotBounce 1.4s infinite;
}

.auth-dot:nth-child(2) { animation-delay: 0.2s; }
.auth-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes authDotBounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
}

.auth-hint {
    background: rgba(139, 92, 246, 0.12);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.4;
    text-align: center;
}

/* PIN Inputs */
.auth-pin-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}

.auth-pin-input {
    width: 40px;
    height: 48px;
    text-align: center;
    font-size: 22px;
    font-weight: 600;
    background: rgba(139, 92, 246, 0.1);
    border: 2px solid rgba(139, 92, 246, 0.3);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Courier New', monospace;
}

.auth-pin-input:focus {
    outline: none;
    border-color: #8b5cf6;
}

/* Auth Spinner */
.auth-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: authSpin 0.8s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

/* ============================================
   SELECTEUR DE THEME (Sombre / Clair)
   ============================================ */

.system-panel-theme-selector {
    padding: 8px 0;
}

.theme-selector-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 6px 8px;
}

.theme-selector-options {
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    padding: 3px;
}

.theme-selector-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.theme-selector-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.theme-selector-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

.theme-selector-btn.active {
    background: rgba(74, 158, 255, 0.15);
    color: var(--accent-blue, #4a9eff);
    font-weight: 600;
}

.theme-selector-btn.click-feedback {
    transform: scale(0.95);
}

/* ============================================
   THEME CLAIR - Variables OS
   ============================================ */

[data-theme="light"] {
    --bg-primary: #edeef3;
    --bg-secondary: #e0e1e9;
    --bg-tertiary: #d3d4df;
    --bg-glass: rgba(228, 229, 236, 0.85);
    --text-primary: #111127;
    --text-secondary: #3d3d58;
    --accent-blue: #4a9eff;
    --accent-purple: #8b5cf6;
    --accent-gradient: linear-gradient(135deg, #4a9eff 0%, #8b5cf6 100%);
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-glow: 0 0 40px rgba(74, 158, 255, 0.1);
}

/* ============================================
   THEME CLAIR - Overrides OS
   ============================================ */

[data-theme="light"] body {
    background: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="light"] .desktop {
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(74, 158, 255, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
        var(--bg-primary);
}

[data-theme="light"] .taskbar {
    background: rgba(228, 229, 236, 0.85);
    border-top: 1px solid var(--border);
}

[data-theme="light"] .taskbar-app {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .taskbar-app:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .taskbar-app.active {
    background: rgba(43, 125, 233, 0.12);
    border-color: rgba(43, 125, 233, 0.35);
    box-shadow: 0 0 12px rgba(43, 125, 233, 0.15);
}

[data-theme="light"] .taskbar-app.active:hover {
    background: rgba(43, 125, 233, 0.18);
    border-color: rgba(43, 125, 233, 0.45);
}

[data-theme="light"] .taskbar-app-title {
    color: var(--text-primary);
}

[data-theme="light"] .taskbar-desktop-btn {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .taskbar-desktop-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .window-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .app-window {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .app-window.focused {
    box-shadow: 
        0 0 0 2px rgba(43, 125, 233, 0.5),
        0 4px 12px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .window-content {
    background: var(--bg-primary);
}

[data-theme="light"] .window-content iframe {
    background: var(--bg-primary);
}

[data-theme="light"] .window-btn {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .window-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .window-btn svg {
    stroke: var(--text-secondary);
}

[data-theme="light"] .window-btn:hover svg {
    stroke: var(--text-primary);
}

[data-theme="light"] .system-tray:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .system-tray.active {
    background: rgba(43, 125, 233, 0.1);
}

[data-theme="light"] .system-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .system-panel-header {
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .system-panel-btn {
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

[data-theme="light"] .system-panel-btn:hover {
    background: rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .system-panel-footer {
    border-top: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .notification-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .notification-item:hover {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .notification-item.unread {
    background: rgba(43, 125, 233, 0.06);
    border-left-color: var(--accent);
}

[data-theme="light"] .account-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

[data-theme="light"] .account-zone:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .account-action-btn {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border);
}

[data-theme="light"] .account-action-btn:hover {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .app-icon-label {
    text-shadow: none;
    color: var(--text-primary);
}

[data-theme="light"] .app-icon:hover {
    background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .notification-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .account-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* Theme selector en mode clair */
[data-theme="light"] .theme-selector-options {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .theme-selector-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-primary);
}

[data-theme="light"] .theme-selector-btn.active {
    background: rgba(43, 125, 233, 0.12);
    color: var(--accent);
}

/* Mode selector en mode clair */
[data-theme="light"] .mode-selector-options {
    background: rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .mode-selector-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .mode-selector-btn.active {
    background: rgba(43, 125, 233, 0.12);
    color: var(--accent);
}

/* Scrollbar en mode clair */
[data-theme="light"] ::-webkit-scrollbar-track {
    background: var(--scrollbar-track, var(--bg-secondary));
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--scrollbar-thumb, rgba(0,0,0,0.18)), var(--scrollbar-thumb-hover, rgba(0,0,0,0.22)));
    border: 2px solid var(--scrollbar-track, var(--bg-secondary));
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--scrollbar-thumb-hover, rgba(0,0,0,0.28)), var(--scrollbar-thumb, rgba(0,0,0,0.22)));
}

/* Auth panel en mode clair */
[data-theme="light"] .auth-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

[data-theme="light"] .auth-form-input {
    background: rgba(124, 58, 237, 0.06);
    border-color: rgba(124, 58, 237, 0.2);
    color: var(--text-primary);
}

/* OS dialog en mode clair */
[data-theme="light"] .os-dialog {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}

[data-theme="light"] .os-dialog-header {
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
}

[data-theme="light"] .os-dialog-input {
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border);
    color: var(--text-primary);
}

[data-theme="light"] .os-dialog-btn {
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-primary);
}

[data-theme="light"] .os-dialog-btn:hover {
    background: rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .os-dialog-footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border);
}