        :root {
            --bg-color: #1a1a1a;
            --surface-color: #2c2c2c;
            --primary-color: #3a7bfd;
            --text-color: #e0e0e0;
            --text-muted-color: #888;
            --border-color: #444;
        }

        .hidden {
            display: none !important;
        }

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


        body {
            font-family: 'Inter', sans-serif;
            background-color: var(--bg-color);
            color: var(--text-color);
            height: 100vh;
            overflow: hidden;
            position: relative;
        }

        .emission-title-display {
            position: absolute;
            top: 40px;
            left: 40px;
            font-size: 1.2em;
            font-weight: 500;
            color: var(--text-muted-color);
        }

        .main-container {
            display: flex;
            height: 100vh;
            overflow: hidden;
        }
        .left-panel {
            width: 400px;
            padding: 40px;
            border-right: 1px solid var(--border-color);
            overflow-y: auto;
            height: 100vh;
            /* Cache la barre de scroll */
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE/Edge */
        }

        /* Cache la barre de scroll pour Chrome/Safari */
        .left-panel::-webkit-scrollbar {
            display: none;
        }

        .right-panel {
            flex-grow: 1;
            padding: 60px 40px;
            display: flex;
            flex-direction: column;
            justify-content: flex-start;
            align-items: center;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
            position: relative;
            overflow-y: auto;
            height: 100vh;
            /* Cache la barre de scroll */
            scrollbar-width: none; /* Firefox */
            -ms-overflow-style: none; /* IE/Edge */
        }

        /* Cache la barre de scroll pour Chrome/Safari */
        .right-panel::-webkit-scrollbar {
            display: none;
        }

        /* 3) Le panneau droit commence en haut et scrolle si besoin */
        .right-panel {
            justify-content: flex-start !important;
            align-items: center;    /* garde ton centrage horizontal */
            overflow-y: auto;       /* autorise le scroll interne si contenu long */
        }

        .right-panel.visible {
            opacity: 1;
            visibility: visible;
        }

        h1 {
            font-weight: 700;
            margin-bottom: 30px;
            text-align: center;
        }

        .nav-button {
            width: 100%;
            padding: 15px 20px;
            margin-bottom: 10px;
            border: 1px solid var(--border-color);
            background-color: var(--surface-color);
            color: var(--text-color);
            border-radius: 8px;
            text-align: left;
            font-family: 'Inter', sans-serif;
            font-size: 1em;
            cursor: pointer;
            transition: background-color 0.2s, border-color 0.2s;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .back-button {
            display: block;
        }

        .type-btn-icon {
            width: 32px;
            height: 32px;
            background-color: var(--primary-color);
            border-radius: 5px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .type-btn-icon:hover {
            background-color: #2a62d0;
        }

        .type-btn-icon svg {
            width: 18px;
            height: 18px;
            fill: white;
        }

        .emission-directory-btn {
            background-color: var(--primary-color) !important;
            border-color: var(--primary-color) !important;
            color: white !important;
        }

        .emission-directory-btn:hover {
            background-color: #2a62d0 !important;
            border-color: #2a62d0 !important;
        }

        .emission-directory-btn.active {
            background-color: var(--primary-color) !important;
            border-color: var(--primary-color) !important;
        }

        .folder-icon {
            background-color: #f39c12 !important;
        }

        .folder-icon:hover {
            background-color: #e67e22 !important;
        }

        .menu-separator {
            height: 1px;
            background-color: var(--border-color);
            margin: 15px 0;
        }

        /* Directory View Styles */
        .directory-view {
            width: 100%;
            max-width: 500px;
        }

        .directory-header {
            margin-bottom: 20px;
        }

        .directory-breadcrumb {
            font-size: 0.9em;
            color: var(--text-muted-color);
            margin-top: 5px;
        }

        .directory-breadcrumb a {
            color: var(--primary-color);
            text-decoration: none;
            cursor: pointer;
        }

        .directory-breadcrumb a:hover {
            text-decoration: underline;
        }

        .directory-actions {
            margin-bottom: 20px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            align-items: flex-start;
        }

        .search-container {
            position: relative;
            width: 100%;
        }

        .search-input {
            width: 100%;
            padding: 10px 40px 10px 12px;
            background-color: var(--bg-color);
            color: var(--text-color);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            font-family: 'Inter', sans-serif;
            font-size: 0.9em;
            transition: border-color 0.2s, box-shadow 0.2s;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(58, 123, 253, 0.3);
        }

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

        .new-folder-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            background-color: var(--primary-color);
            color: white;
            border: none;
            border-radius: 6px;
            font-family: 'Inter', sans-serif;
            font-weight: 500;
            font-size: 0.9em;
            cursor: pointer;
            transition: background-color 0.2s;
            white-space: nowrap;
        }

        .new-folder-btn:hover {
            background-color: #2a62d0;
        }

        .directory-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .directory-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background-color: var(--bg-color);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            margin-bottom: 8px;
            transition: background-color 0.2s, border-color 0.2s;
        }

        .directory-item:hover {
            background-color: var(--hover-bg-color);
            border-color: var(--primary-color);
        }

        .directory-item-info {
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 1;
            cursor: pointer;
        }

        .directory-item-icon {
            width: 20px;
            height: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .directory-item-icon.folder {
            color: #ffa500;
        }

        .directory-item-icon.file {
            color: var(--text-muted-color);
        }

        .directory-item-name {
            flex: 1;
            word-wrap: break-word;
            word-break: break-word;
            overflow-wrap: break-word;
        }

        .file-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 0px;
            background-color: var(--bg-color);
            border-radius: 8px;
            margin-bottom: 8px;
            transition: background-color 0.2s;
        }

        .file-item:hover {
            background-color: var(--hover-bg-color);
        }

        .file-item-info {
            display: flex;
            align-items: center;
            gap: 12px;
            flex: 1;
            padding-left: 0dvb;
        }

        .file-item-name {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        .file-item .dl-button {
            margin-right: 0px;
        }

        .file-item-details {
            display: flex;
            flex-direction: column;
        }

        .file-item-title {
            font-weight: normal;
            margin-bottom: 2px;
        }

        .file-item-meta {
            display: flex;
            gap: 8px;
            color: var(--text-muted-color);
            font-size: 0.75em;
        }

        .file-item-folder {
            color: var(--text-muted-color);
            font-size: 0.75em;
        }

        .file-item-root {
            color: var(--text-muted-color);
            font-size: 0.75em;
        }

        .file-item-date {
            color: var(--text-muted-color);
            font-size: 0.75em;
        }

        .delete-folder-btn {
            width: 24px;
            height: 24px;
            background-color: #dc3545;
            color: white;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background-color 0.2s;
            margin-left: 8px;
        }

        .delete-folder-btn:hover {
            background-color: #c82333;
        }

        .delete-folder-btn svg {
            width: 14px;
            height: 14px;
        }

        .download-view {
            width: 100%;
            max-width: 500px;
        }

        .download-list {
            list-style: none;
            padding: 0;
            margin: 20px 0;
        }

        .download-list li {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px;
            background-color: var(--bg-color);
            border-radius: 6px;
            margin-bottom: 8px;
            gap: 10px;
        }

        .download-list li span {
            flex: 1;
            word-wrap: break-word;
            word-break: break-word;
            overflow-wrap: break-word;
        }

        .dl-button {
            padding: 6px 10px;
            font-size: 0.8em;
            background-color: var(--primary-color);
            border: none;
            border-radius: 4px;
            color: white;
            cursor: pointer;
            white-space: nowrap;
            transition: background-color 0.2s;
        }

        .dl-button-text {
            display: inline;
        }

        .dl-button-icon {
            display: inline-block;
        }

        .dl-button:hover {
            background-color: #2a62d0;
        }

        .nav-button:hover {
            background-color: #383838;
            border-color: var(--text-muted-color);
        }

        .back-button {
            background-color: transparent;
            border-color: transparent;
            color: var(--text-muted-color);
            margin-bottom: 15px;
        }

        .back-button:hover {
            background-color: var(--surface-color);
            color: var(--text-color);
            border-color: var(--border-color);
        }

        .nav-step.hidden {
            display: none;
        }

        .form-container {
            width: 100%;
            max-width: 500px;
            background-color: var(--surface-color);
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);


        }

	.version-selector {
	  display: grid;              /* <-- visible par défaut */
	  grid-template-columns: 1fr 1fr;
	  gap: 10px;
	  margin-bottom: 10px;
	}


        .version-btn {
            padding: 8px;
            border: 2px solid var(--border-color);
            background-color: var(--bg-color);
            color: var(--text-color);
            border-radius: 5px;
            font-family: 'Inter', sans-serif;
            font-size: 0.8em !important;
            cursor: pointer;
            transition: all 0.2s;
        }

        .version-btn:hover {
            border-color: var(--text-muted-color);
            background-color: var(--surface-color);
        }

        .version-btn.active {
            border-color: var(--primary-color);
            background-color: var(--primary-color);
            color: white;
            font-weight: 500;
        }

	.synthe-example {
	  display: block;             /* <-- affichable lorsque 'hidden' est retiré */
	  width: 90%;
	  border-radius: 6px;
	  margin: 10px auto 10px auto;
	}


        .header-logo {
            width: 100%;
            margin-bottom: 30px;
            /*filter: invert(1);*/
        }

        #formTitle {
            font-size: 1.1em;
            font-weight: 500;
            margin-bottom: 0px;
            text-align: center;
            visibility: hidden;
        }

        label {
            display: block;
            margin-bottom: 5px;
            font-size: 0.9em;
            color: var(--text-muted-color);
        }

        input[type="text"], input[type="file"] {
            width: 100%;
            padding: 10px;
            margin-bottom: 15px;
            border: 1px solid var(--border-color);
            border-radius: 5px;
            background-color: var(--bg-color);
            color: var(--text-color);
            font-family: 'Inter', sans-serif;
        }

        select {
            width: 100%;
            padding: 10px;
            margin-bottom: 15px;
            border: 1px solid var(--primary-color);
            border-radius: 5px;
            background-color: var(--primary-color);
            color: white;
            font-family: 'Inter', sans-serif;
            font-size: 14px;
            cursor: pointer;
            appearance: none;
            background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='white' viewBox='0 0 16 16'%3e%3cpath d='m7.247 4.86-4.796 5.481c-.566.647-.106 1.659.753 1.659h9.592a1 1 0 0 0 .753-1.659l-4.796-5.48a1 1 0 0 0-1.506 0z'/%3e%3c/svg%3e");
            background-repeat: no-repeat;
            background-position: right 10px center;
            background-size: 12px;
        }

        select:hover {
            background-color: #2a62d0;
        }

        select option {
            background-color: var(--bg-color);
            color: var(--text-color);
            padding: 8px;
        }

        input[type="text"]:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(58, 123, 253, 0.3);
        }

        .form-container button {
            width: 100%;
            padding: 14px;
            border: none;
            border-radius: 6px;
            background-color: var(--primary-color);
            color: white;
            font-family: 'Inter', sans-serif;
            font-weight: 500;
            font-size: 1em;
            cursor: pointer;
            transition: background-color 0.2s;
            margin-top: 10px;
        }

        .form-container button:hover {
            background-color: #2a62d0;
        }

        /* --- STYLES BANC TITRE (V1) --- */

        .image-upload-zone {
            position: relative;
            border: 2px dashed var(--border-color);
            border-radius: 8px;
            padding: 20px;
            text-align: center;
            background-color: var(--bg-color);
            min-height: 150px;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            margin-bottom: 20px;
            overflow: hidden;
            transition: border-color 0.2s;
        }

        .image-upload-zone:hover {
            border-color: var(--text-muted-color);
        }

        .image-input {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            opacity: 0;
            cursor: pointer;
            z-index: 1;
        }

        .upload-placeholder {
            color: var(--text-muted-color);
            pointer-events: none;
        }

        .image-preview {
            max-width: 100%;
            max-height: 200px;
            height: auto;
            object-fit: contain;
            border-radius: 4px;
            pointer-events: none;
        }

        .image-upload-zone .image-preview:not(.hidden) ~ .upload-placeholder {
            display: none;
        }

        /* --- STYLES BANC TITRE (V2) --- */
        .banc-titre-preview-v2 {
            display: flex;
            gap: 10px;
            margin-bottom: 20px;
        }

        .image-preview-wrapper {
            flex: 1;
            background-color: var(--bg-color);
            border: 2px dashed var(--border-color);
            border-radius: 8px;
            min-height: 150px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            position: relative;
            transition: border-color 0.2s;
            text-align: center;
        }

        .image-preview-wrapper:hover {
            border-color: var(--text-muted-color);
        }

        .image-preview-wrapper .upload-placeholder {
            color: var(--text-muted-color);
            pointer-events: none;
            font-size: 0.9em;
            padding: 0 10px;
        }

        .banc-titre-preview-v2 .image-preview {
            max-width: 100%;
            max-height: 130px;
            object-fit: contain;
            display: block;
            pointer-events: none;
        }

        .image-preview-wrapper .image-preview:not(.hidden) ~ .upload-placeholder {
            display: none;
        }

        /* --- Styles pour Bouton Recadrer (ICÔNE) --- */
        .crop-btn {
            position: absolute;
            bottom: 8px; /* Position en bas */
            left: 8px; /* Position à gauche */
            width: auto !important;  /* <--- Largeur automatique pour le texte */
            height: 32px !important; /* <--- Hauteur fixe */
            background-color: var(--primary-color) !important;
            color: white !important;
            border: none !important;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s;
            z-index: 5;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 0 8px !important;
            margin: 0 !important;
            font-family: 'Inter', sans-serif !important;
            font-size: 0.8em !important;
            font-weight: 500 !important;
            gap: 4px;
        }

        .crop-btn:hover {
            background-color: #2a62d0 !important;
        }

        .crop-btn svg {
            width: 16px;
            height: 16px;
        }

        .image-preview-wrapper .image-input {
            z-index: 1;
        }


        /* --- Styles pour Modal Cropper --- */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;

        }

        .modal-content {
            background-color: var(--surface-color);
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 10px 40px rgba(0,0,0,0.4);
            width: 100%;
            max-width: 1000px;
            z-index: 1001;
            display: flex;
            flex-direction: column;


        }

        #cropper-image-container {
            width: 100%;
            height: 600px;
            background-color: var(--bg-color);
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 20px;
        }

        #cropper-image {
            display: block;
            max-width: 100%;
        }

        /* [AJOUT] Conteneur pour le slider de rotation */
        .modal-controls {
            display: flex;
            align-items: center;
            gap: 15px;
            margin-bottom: 20px;
            padding: 0 10px;
        }

        .modal-controls label {
            margin-bottom: 0;
            white-space: nowrap;
        }

        .modal-controls input[type="range"] {
            flex-grow: 1;
            cursor: pointer;
        }

        .modal-controls #rotation-value {
            width: 45px;
            text-align: right;
            font-size: 0.9em;
            color: var(--text-color);
        }

        .modal-controls #reset-rotation-btn {
            padding: 6px 10px;
            font-size: 0.8em;
            background-color: var(--border-color);
            color: var(--text-color);
        }
        .modal-controls #reset-rotation-btn:hover {
            background-color: #555;
        }

        /* [AJOUT] Style minimal pour le slider en thème sombre */
        input[type=range] {
            -webkit-appearance: none;
            width: 100%;
            height: 8px;
            background: var(--bg-color);
            border-radius: 5px;
            outline: none;
        }

        input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 20px;
            height: 20px;
            background: var(--primary-color);
            border-radius: 50%;
            cursor: pointer;
        }

        input[type=range]::-moz-range-thumb {
            width: 20px;
            height: 20px;
            background: var(--primary-color);
            border-radius: 50%;
            cursor: pointer;
        }

        /* [MODIFICATION] Actions en bas */
        .modal-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            width: 100%;
        }

        .modal-actions-group {
            display: flex;
            gap: 10px;
        }

        .modal-actions button {
            padding: 10px 18px;
            border: none;
            border-radius: 6px;
            font-family: 'Inter', sans-serif;
            font-weight: 500;
            font-size: 0.95em;
            cursor: pointer;
            transition: background-color 0.2s;
        }

        .crop-ratio-btn {
            background-color: var(--border-color);
            color: var(--text-color);
        }
        .crop-ratio-btn:hover {
            background-color: #555;
        }
        .crop-ratio-btn.active {
            background-color: var(--primary-color);
            color: white;
        }

        #confirm-crop-btn {
            background-color: var(--primary-color);
            color: white;
        }
        #confirm-crop-btn:hover {
            background-color: #2a62d0;
        }

        #cancel-crop-btn {
            background-color: var(--border-color);
            color: var(--text-color);
        }
         #cancel-crop-btn:hover {
            background-color: #555;
         }


        /* [AJOUT] Ligne d’actions sous la recherche */
        .search-secondary-actions {
            width: 100%;
            display: flex;
            justify-content: flex-end;
            margin-top: 8px;
        }

        /* [AJOUT] Bouton “Tout télécharger” (même style que .new-folder-btn) */
        .bulk-dl-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 16px;
            background-color: var(--primary-color);
            color: white;
            border: none;
            border-radius: 6px;
            font-family: 'Inter', sans-serif;
            font-weight: 500;
            font-size: 0.9em;
            cursor: pointer;
            transition: background-color 0.2s;
            white-space: nowrap;
        }
        .bulk-dl-btn:hover { background-color: #2a62d0; }
        .bulk-dl-btn.hidden { display: none !important; }


        @media (max-width: 767px) {
            body { height: auto; overflow: auto; }
            .main-container { flex-direction: column; height: auto; }
            .left-panel { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); height: auto; padding: 20px; }
            .nav-button { max-width: 250px; margin: 0 auto 10px; text-align: center; }
            .type-btn { display: flex !important; justify-content: space-between; align-items: center; text-align: left; }
            .type-btn-icon { flex-shrink: 0; margin-left: 10px; }
            .right-panel { padding-top: 20px; }
            .emission-title-display { position: static; margin-bottom: 20px; text-align: center; }
            .header-logo { max-width: 250px; margin: 0 auto 30px; }
            .download-list { font-size: 0.75em; }
            .download-list li { padding: 6px; font-size: 0.8em; gap: 8px; }
            .download-list li span { min-width: 0; }
            .download-list .dl-button { font-size: 0.75em; padding: 8px; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
            .dl-button-text { display: none; }
            .dl-button-icon { display: block; width: 16px; height: 16px; }
            .dl-button-icon svg { width: 100%; height: 100%; fill: white; }
            .form-container { margin-top: 0; }
            .download-view { padding: 0 10px; margin-top: 0; }
            .download-view h2 { font-size: 1.1em; margin-bottom: 15px; }
            #formTitle { font-size: 1.2em; }

            /* Modal en mobile */
            .modal-overlay { padding: 10px; }
            .modal-content { width: 100%; padding: 10px; }
            #cropper-image-container { height: 350px; }

            /* [MODIFICATION] Layout mobile */
            .modal-controls { flex-wrap: wrap; padding: 0; }
            .modal-controls input[type="range"] { order: 2; width: 100%; flex-grow: 1; }
            .modal-controls label { order: 1; }
            .modal-controls #rotation-value { order: 1; }
            .modal-controls #reset-rotation-btn { order: 1; margin-left: auto; }

            .modal-actions { flex-direction: column; gap: 10px; }
            .modal-actions-group { width: 100%; display: flex; }
            .modal-actions-group button { flex: 1; }
        }


/* 4) Footer premium en bas de la sidebar */
.left-panel {
  display: flex;
  flex-direction: column;
}
.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 5) Boutons premium (style classe) */
.premium-btn {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02)) padding-box,
    linear-gradient(135deg, rgba(255,255,255,.15), rgba(255,255,255,0)) border-box;
  border: 1px solid transparent;
  color: #fff; text-decoration: none; font-weight: 500; letter-spacing: .2px;
  box-shadow: 0 4px 20px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(6px);
  transition: transform .15s ease, box-shadow .15s ease, background .2s ease;
}
.premium-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.08);
}
.premium-btn .btn-ico { width: 18px; height: 18px; display: inline-block; opacity: .9; }
.premium-btn.admin {
  background:
    linear-gradient(180deg, rgba(58,123,253,.18), rgba(58,123,253,.06)) padding-box,
    linear-gradient(135deg, rgba(88,140,255,.45), rgba(58,123,253,.0)) border-box;
}
.premium-btn.logout {
  background:
    linear-gradient(180deg, rgba(255,95,109,.18), rgba(255,95,109,.06)) padding-box,
    linear-gradient(135deg, rgba(255,135,135,.45), rgba(255,95,109,.0)) border-box;
}
.premium-note { font-size: .78em; color: var(--text-muted-color); text-align: center; margin-top: 2px; }



/* gens modern cards */
.gens-header {
  display:flex; align-items:center; justify-content:space-between; gap:.75rem; margin-bottom:1rem;
}
.gens-tools { display:flex; gap:.5rem; }
.gens-input {
  min-width:200px; padding:.5rem .75rem; border:1px solid var(--border-color,#444);
  background:var(--surface-color,#2c2c2c); color:var(--text-color,#e0e0e0); border-radius:.5rem;
}
.gens-btn {
  padding:.5rem .75rem; border:1px solid var(--border-color,#444);
  background:transparent; color:var(--text-color,#e0e0e0);
  border-radius:.5rem; cursor:pointer; transition:.2s ease;
}
.gens-btn:hover { border-color:var(--primary-color,#3a7bfd); }
.gens-btn.danger { border-color:#b03; color:#f3b; }

.gens-grid {
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap:1rem;
}
.gen-card {
  background:var(--surface-color,#2c2c2c);
  border:1px solid var(--border-color,#444);
  border-radius:1rem; padding:1rem; display:flex; flex-direction:column; gap:.5rem;
  box-shadow:0 0 0 transparent; transition:box-shadow .2s ease, transform .08s ease;
}
.gen-card:hover { box-shadow:0 10px 24px rgba(0,0,0,.25); transform:translateY(-1px); }

.gen-row { display:flex; gap:.75rem; }
.gen-top { align-items:center; justify-content:space-between; margin-bottom:.25rem; }
.gen-id { font-weight:700; opacity:.9; }
.gen-status {
  font-size:.75rem; padding:.25rem .5rem; border-radius:999px; border:1px solid #555;
  text-transform:uppercase; letter-spacing:.03em;
}
.gen-status.success { border-color:#1b7f3a; color:#8cffb2; }
.gen-status.failed { border-color:#7f1b1b; color:#ff9e9e; }
.gen-status.pending, .gen-status.running, .gen-status.queued { border-color:#7f6a1b; color:#ffd98c; }

.gen-k { width:96px; flex:0 0 96px; font-size:.8rem; color:var(--text-muted-color,#888); }
.gen-v { flex:1 1 auto; overflow-wrap:anywhere; }

.gen-dates { gap:1rem; flex-wrap:wrap; }
.gen-date { display:flex; gap:.5rem; align-items:center; }
.gen-actions { display:flex; gap:.5rem; flex-wrap:wrap; margin-top:.5rem; }

.gen-card.video-ready .vn a { color:var(--primary-color,#3a7bfd); text-decoration:underline; }

/* icones pour les actions de generation */
.gen-actions{ display:flex; gap:.5rem; flex-wrap:wrap; }
.icon-btn{
  width:36px; height:36px; display:inline-flex; align-items:center; justify-content:center;
  border:1px solid var(--border-color); background:transparent; color:var(--text-color);
  border-radius:8px; cursor:pointer; transition:transform .08s ease, border-color .2s;
}
.icon-btn:hover{ border-color:var(--primary-color); transform:translateY(-1px); }
.icon-btn.danger{ border-color:#7f1b1b; color:#ff9e9e; }
.icon-btn i{ font-size:14px; line-height:1; }

/* bouton d’icône login */
.login-btn{
  width:100%;
  padding:14px;
  border:none;
  border-radius:6px;
  background-color:var(--primary-color);
  color:white;
  font-size:1.2em;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  transition:background-color .2s, transform .08s ease;
}
.login-btn:hover{
  background-color:#2a62d0;
  transform:translateY(-1px);
}
.login-btn i{
  font-size:20px;
}

/* login */
.login-wrap { max-width:420px; margin:100px auto; background:#222; padding:24px; border-radius:8px; }
.login-form label { margin:8px 0 4px; display:block; }

/* login fields */
input[type="text"], input[type="password"] {
  width:100%; padding:12px; margin-bottom:20px;
  background-color:var(--bg-color); color:var(--text-color);
  border:1px solid var(--border-color); border-radius:6px;
  font-family:'Inter',sans-serif; transition:border-color .2s, box-shadow .2s;
}
input[type="text"]:focus, input[type="password"]:focus {
  outline:none; border-color:var(--primary-color);
  box-shadow:0 0 0 3px rgba(58,123,253,.3);
}

/* login buttons */
.login-form button {
  width:100%; padding:14px; border:none; border-radius:6px;
  background-color:var(--primary-color); color:white;
  font-family:'Inter',sans-serif; font-weight:500; font-size:1em;
  cursor:pointer; transition:background-color .2s;
}
.login-form button:hover { background-color:#2a62d0; }

/* bouton d’icône login */
.login-btn{
  width:100%; padding:14px; border:none; border-radius:6px;
  background-color:var(--primary-color); color:white; font-size:1.2em;
  cursor:pointer; display:flex; align-items:center; justify-content:center;
  transition:background-color .2s, transform .08s ease;
}
.login-btn:hover{ background-color:#2a62d0; transform:translateY(-1px); }
.login-btn i{ font-size:20px; }

/* === Footer R&G === */
footer {
  position: fixed;
  bottom: 0;
  left: 400px; /* largeur de la sidebar */
  right: 0;
  height: 30px;
  display: flex;
  justify-content: center;      /* centre horizontalement le texte */
  align-items: center;          /* centre verticalement */
  background: var(--surface-color, #2c2c2c);
  color: var(--text-muted-color, #aaa);
  border-top: 1px solid var(--border-color, #444);
  z-index: 50;
  font-size: 0.9em;
  letter-spacing: 0.3px;
}

/* Lien dans le footer */
footer a {
  color: #fff;                  /* blanc fixe */
  font-weight: 700;             /* bold */
  text-decoration: none;        /* pas de soulignement */
  transition: opacity .2s;
}

footer a:hover {
  opacity: 0.85;                /* léger effet au survol */
}

/* Espace bas pour que le contenu ne soit pas masqué par le footer fixe */
.right-panel {
  padding-bottom: 72px;
}

/* En mobile : footer pleine largeur */
@media (max-width: 767px) {
  footer { left: 0; right: 0; }
}


  /* --- NOTIF CENTER (responsive) --- */
  .notif-center{ position:relative; display:inline-block; margin-left:8px; }
  .notif-btn{ position:relative; border:none; background:transparent; cursor:pointer; padding:6px 8px; font-size:18px; }
  .notif-badge{ position:absolute; top:-2px; right:-2px; background:#e53935; color:#fff; border-radius:999px; padding:0 6px; font-size:12px; line-height:18px; min-width:18px; text-align:center; }
  .hidden{ display:none !important; }

  .notif-panel{
    position:absolute;
    right:0;
    bottom:36px;
    width: min(92vw, 480px);
    max-width: 100vw;
    max-height: 72vh;
    overflow-y: auto;
    overflow-x: hidden;     /* pas de scroll horizontal */
    background:#1f1f1f; color:#fff;
    border:1px solid #333; border-radius:12px;
    box-shadow:0 12px 28px rgba(0,0,0,0.4);
    box-sizing: border-box;
  }
  @media (max-width: 767px){
    .notif-panel{
      position: fixed;
      left: 8px;
      right: 8px;
      bottom: 64px;
      width: auto;
      max-height: 70vh;
      border-radius: 14px;
    }
  }

  .notif-header,.notif-footer{
    padding:10px 12px; border-bottom:1px solid #2a2a2a;
    display:flex; justify-content:space-between; align-items:center;
  }
  .notif-footer{ border-top:1px solid #2a2a2a; border-bottom:none; }
  .notif-list{ list-style:none; margin:0; padding:0; }

  .notif-item{
    padding:10px 12px; border-bottom:1px solid #2a2a2a;
    display:flex; gap:10px; align-items:flex-start;
  }
  .notif-item:last-child{ border-bottom:none; }
  /* Etat non-lu : liseré + fond léger */
  .notif-item.is-unread{
    border-left: 4px solid #58d38c;
    background: linear-gradient(180deg, rgba(40,80,60,.25), rgba(31,31,31,0));
  }

  .notif-main{ flex: 1 1 auto; min-width:0; }
  .notif-title{
    font-weight:600;
    overflow-wrap:anywhere; word-break:break-word; margin:0 0 2px 0;
  }
  .notif-meta{ font-size:12px; color:#bbb; }

  .notif-actions{ flex: 0 0 auto; display:flex; gap:8px; align-items:center; }
  .icon-btn{
    width:30px; height:30px;
    display:inline-flex; align-items:center; justify-content:center;
    background:none; border:none; cursor:pointer; color:#6aa8ff;
    border-radius:8px;
  }
  .icon-btn:hover{ background:#2a2a2a; }
  .icon-btn.danger{ color:#f36b6b; }
  .icon-btn i{ font-size:14px; line-height:1; }

  /* Bouton "Tout marquer comme lu" — compact, neutre, responsive */
  .notif-mark-btn{
    display:inline-flex;
    align-items:center;
    gap:6px;
    background:transparent;
    color:#ddd;
    border:1px solid #3a3a3a;
    border-radius:6px;
    padding:4px 8px;          /* compact */
    font-size:12px;
    line-height:1.2;
    cursor:pointer;
    white-space:nowrap;       /* évite le retour à la ligne */
    transition:background .15s ease, border-color .15s ease, color .15s ease;
  }
  .notif-mark-btn i{ font-size:12px; color:#bfbfbf; }
  .notif-mark-btn:hover{ background:#232323; border-color:#4a4a4a; color:#f2f2f2; }
  .notif-mark-btn:focus-visible{
    outline:2px solid #6aa8ff; outline-offset:2px; border-color:#6aa8ff;
  }
  .notif-mark-btn:active{ transform:none; } /* pas d’effet “gros” au clic */

  /* Header spacing: évite que le bouton déborde */
  .notif-header{ gap:8px; }
  .notif-header strong{ font-size:13px; }

  /* Mobile: encore plus discret */
  @media (max-width: 767px){
    .notif-mark-btn{
      padding:3px 7px;
      font-size:11px;
      gap:5px;
    }
    .notif-mark-btn i{ font-size:11px; }
  }

  /* Respecte reduced motion */
  @media (prefers-reduced-motion: reduce){
    .notif-mark-btn{ transition:none; }
  }


/* Overlay de progression ZIP */
.zip-loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
}
.zip-loading-card {
  background: #1f1f1f;
  border: 1px solid #3a3a3a;
  border-radius: 14px;
  padding: 18px 20px;
  min-width: 280px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: flex; align-items: center; gap: 12px;
  color: #eaeaea; font-weight: 500;
}
.zip-spinner {
  width: 22px; height: 22px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: rgba(255,255,255,0.9);
  animation: zipspin 0.9s linear infinite;
}
@keyframes zipspin { to { transform: rotate(360deg); } }

/* Etat désactivé “propre” du bouton */
.bulk-dl-btn[aria-busy="true"] {
  pointer-events: none;
  opacity: 0.7;
}


/* ====== TABLEAU LOGS (amélioré) ====== */
.logs-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 0.9rem;
}
.logs-table thead th {
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--text-muted-color);
  border-bottom: 1px solid var(--border-color);
}
.logs-table tbody tr {
  background: var(--bg-color);
  transition: background 0.2s, transform 0.1s;
}
.logs-table tbody tr:hover {
  background: #262626;
  transform: translateY(-1px);
}
.logs-table td {
  padding: 8px 14px;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  color: var(--text-color);
  white-space: nowrap;
}
.logs-table td:first-child {
  border-left: 1px solid var(--border-color);
  border-radius: 8px 0 0 8px;
}
.logs-table td:last-child {
  border-right: 1px solid var(--border-color);
  border-radius: 0 8px 8px 0;
}
.logs-table tbody tr:nth-child(odd) {
  background: var(--surface-color);
}
.logs-status {
  font-weight: 600;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.8rem;
}
.logs-status.success {
  color: #00d17a;
  background: rgba(0, 209, 122, 0.1);
}
.logs-status.error {
  color: #ff6767;
  background: rgba(255, 103, 103, 0.1);
}
.logs-status.pending {
  color: #facc15;
  background: rgba(250, 204, 21, 0.1);
}
.file-item.highlight {
  outline: 2px solid #3a7bfd;
  background: rgba(58,123,253,0.12);
  border-radius: 10px;
  animation: revonPulse 1.2s ease-in-out 2;
}
@keyframes revonPulse {
  0%   { box-shadow: 0 0 0 0 rgba(58,123,253,0.5); }
  70%  { box-shadow: 0 0 0 10px rgba(58,123,253,0.0); }
  100% { box-shadow: 0 0 0 0 rgba(58,123,253,0.0); }
}

.directory-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid #18212f;
  background: #050816;
  box-sizing: border-box;
  height: 56px;
}

.file-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

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

.file-item-title {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 360px;
}

.file-item-meta {
  font-size: 11px;
  opacity: 0.7;
  display: flex;
  gap: 4px;
  align-items: center;
}

.file-item-sep {
  opacity: 0.5;
}

.dl-button.icon-only {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: #111827;
  cursor: pointer;
  flex-shrink: 0;
  text-decoration: none;
}

.dl-button.icon-only svg {
  width: 16px;
  height: 16px;
}

.directory-item-icon.file svg {
  width: 18px;
  height: 18px;
}

/* AUDIO */
.audio-upload-zone {
  padding: 0;
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  background-color: var(--bg-color);
  margin-bottom: 20px;
  overflow: hidden;
}

/* zone cliquable uniquement */
.audio-drop-area {
  position: relative;
  height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
}

.audio-drop-area:hover {
  border-color: var(--text-muted-color);
}

.audio-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.upload-placeholder {
  color: var(--text-muted-color);
  pointer-events: none;
  z-index: 1;
}

/* zone NON cliquable pour affichage nom + lecteur audio */
.audio-info-zone {
  padding: 10px 12px;
  background-color: #111;
}

/* nom du fichier en blanc */
.audio-file-name {
  color: white !important;
  font-size: 0.9em;
  margin-bottom: 6px;
  word-break: break-all;
}

