        :root {
            --primary: #4f46e5;
            --primary-dark: #4338ca;
            --success: #10b981;
            --warning: #f59e0b;
            --error: #ef4444;
            --bg-dark: #1a1a2e;
            --bg-card: #16213e;
            --text: #e2e8f0;
            --text-muted: #94a3b8;
            --border: #334155;
        }

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

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

        .container {
            max-width: 900px;
            margin: 0 auto;
            padding: 20px;
        }

        header {
            text-align: center;
            padding: 20px 0;
            margin-bottom: 20px;
        }

        header h1 {
            font-size: 2rem;
            margin-bottom: 10px;
        }

        header p {
            color: var(--text-muted);
        }

        .card {
            background: var(--bg-card);
            border-radius: 12px;
            padding: 24px;
            margin-bottom: 20px;
            border: 1px solid var(--border);
        }

        .card h2 {
            font-size: 1.2rem;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* Configuration Form */
        .config-section {
            display: none;
        }

        .config-section.active {
            display: block;
        }

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

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

        .form-group input, .form-group select {
            width: 100%;
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: 8px;
            background: var(--bg-dark);
            color: var(--text);
            font-size: 1rem;
        }

        .form-group input:focus, .form-group select:focus {
            outline: none;
            border-color: var(--primary);
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 16px;
        }

        @media (max-width: 600px) {
            .form-row {
                grid-template-columns: 1fr;
            }
        }

        /* Custom select with input option */
        .select-with-custom {
            position: relative;
        }

        .select-with-custom .custom-input {
            display: none;
            margin-top: 8px;
        }

        .select-with-custom .custom-input.visible {
            display: block;
        }

        .custom-badge {
            display: inline-block;
            font-size: 0.7rem;
            padding: 2px 6px;
            background: var(--warning);
            color: #000;
            border-radius: 4px;
            margin-left: 8px;
        }

        /* Champs en lecture seule / grises */
        .form-group input:disabled, .form-group input.readonly-field {
            background: #0d1117;
            color: var(--text-muted);
            cursor: not-allowed;
            border-color: #1e293b;
        }

        .form-group .field-locked {
            font-size: 0.7rem;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .form-group .field-locked::before {
            content: "🔒 ";
        }

        /* Info serveur (en bas de la carte, avec couleur selon état) */
        .server-info {
            margin-top: 16px;
            padding: 10px 12px;
            border-radius: 8px;
            font-size: 0.8rem;
            text-align: center;
        }

        .server-info.success {
            background: rgba(16, 185, 129, 0.1);
            border: 1px solid var(--success);
            color: var(--success);
        }

        .server-info.success::before {
            content: "✓ ";
        }

        .server-info.error {
            background: rgba(239, 68, 68, 0.1);
            border: 1px solid var(--error);
            color: var(--error);
        }

        .server-info.error::before {
            content: "✗ ";
        }

        /* Import mode choice buttons */
        .import-mode-choice {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 12px;
            margin-top: 16px;
        }

        .btn-mode {
            display: flex;
            flex-direction: row;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 14px 16px;
            background: var(--bg-dark);
            border: 2px solid var(--border);
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-mode:hover {
            border-color: var(--primary);
            background: rgba(79, 70, 229, 0.1);
        }

        .btn-mode .mode-icon {
            font-size: 24px;
        }

        .btn-mode .mode-title {
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--text);
        }

        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 12px 24px;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

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

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

        .btn-primary:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

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

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

        .btn-small {
            padding: 6px 12px;
            font-size: 0.875rem;
        }

        /* Drop Zone */
        .drop-zone {
            border: 2px dashed var(--border);
            border-radius: 12px;
            padding: 32px 20px;
            text-align: center;
            transition: all 0.3s;
            cursor: pointer;
        }

        .drop-zone:hover, .drop-zone.dragover {
            border-color: var(--primary);
            background: rgba(79, 70, 229, 0.1);
        }

        .drop-zone-icon {
            font-size: 36px;
            margin-bottom: 12px;
        }

        .drop-zone-text {
            color: var(--text-muted);
            margin-bottom: 8px;
        }

        .drop-zone-hint {
            font-size: 0.875rem;
            color: var(--text-muted);
        }

        /* File List */
        .file-list {
            max-height: 300px;
            overflow-y: auto;
            margin-top: 16px;
        }

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

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

        .file-name {
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .file-size {
            color: var(--text-muted);
            font-size: 0.875rem;
            white-space: nowrap;
        }

        .file-remove {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px 8px;
            font-size: 1.2rem;
        }

        .file-remove:hover {
            color: var(--error);
        }

        /* Progress */
        .progress-section {
            display: none;
        }

        .progress-section.active {
            display: block;
        }

        .progress-bar-container {
            background: var(--bg-dark);
            border-radius: 8px;
            height: 24px;
            overflow: hidden;
            margin: 16px 0;
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--primary), var(--success));
            border-radius: 8px;
            transition: width 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 0.875rem;
            font-weight: 600;
        }

        /* v10.16: Animation de vérification */
        .progress-bar.verifying {
            background: linear-gradient(90deg, var(--primary), #f39c12, var(--primary));
            background-size: 200% 100%;
            animation: verifying-pulse 1.5s ease-in-out infinite;
        }

        @keyframes verifying-pulse {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        /* v10.16: Modal de décision utilisateur */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            backdrop-filter: blur(4px);
        }

        .modal-content {
            background: var(--bg-card);
            border-radius: 16px;
            padding: 32px;
            max-width: 480px;
            width: 90%;
            text-align: center;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
        }

        .modal-stats {
            display: flex;
            justify-content: center;
            gap: 32px;
            margin: 16px 0;
            padding: 16px;
            background: var(--bg-secondary);
            border-radius: 8px;
        }

        .modal-stats .stat-existing {
            color: var(--success);
            font-weight: 600;
        }

        .modal-stats .stat-new {
            color: var(--primary);
            font-weight: 600;
        }

        .modal-buttons {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .modal-buttons .btn {
            width: 100%;
            padding: 14px 20px;
        }

        .modal-buttons .btn-recommended {
            background: var(--success);
            border-color: var(--success);
        }

        .modal-buttons .btn-recommended:hover {
            background: #1e8449;
        }

        .progress-stats {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px;
            text-align: center;
        }

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

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

        .current-file {
            margin-top: 16px;
            padding: 12px;
            background: var(--bg-dark);
            border-radius: 8px;
            font-size: 0.875rem;
        }

        .current-file-label {
            color: var(--text-muted);
            margin-bottom: 4px;
        }

        /* Status Messages */
        .status-message {
            padding: 12px 16px;
            border-radius: 8px;
            margin-bottom: 16px;
            display: none;
        }

        .status-message.visible {
            display: block;
        }

        .status-message.success {
            background: rgba(16, 185, 129, 0.2);
            border: 1px solid var(--success);
            color: var(--success);
        }

        .status-message.error {
            background: rgba(239, 68, 68, 0.2);
            border: 1px solid var(--error);
            color: var(--error);
        }

        .status-message.warning {
            background: rgba(245, 158, 11, 0.2);
            border: 1px solid var(--warning);
            color: var(--warning);
        }

        /* Actions */
        .actions {
            display: flex;
            gap: 12px;
            margin-top: 20px;
        }

        /* Summary - v10.17.13: Style compact sur une ligne */
        .summary {
            background: var(--bg-dark);
            border-radius: 8px;
            padding: 12px 16px;
            margin-bottom: 16px;
            font-size: 0.95rem;
        }

        /* Hidden file input */
        #fileInput {
            display: none;
        }

        /* Loading spinner */
        .spinner {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 2px solid transparent;
            border-top-color: currentColor;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

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

        /* Date validation message */
        .date-hint {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-top: 4px;
        }

        .date-error {
            color: var(--error);
        }

        /* Loading overlay for config fetch */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(26, 26, 46, 0.9);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }

        .loading-overlay.hidden {
            display: none;
        }

        .loading-content {
            text-align: center;
        }

        .loading-content .spinner {
            width: 40px;
            height: 40px;
            margin-bottom: 16px;
        }

        /* v10.14.2: Bandeau admin (blocage, annulation, etc.) */
        .admin-banner {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
            color: #212529;
            padding: 12px 20px;
            text-align: center;
            font-weight: 600;
            z-index: 10000;
            box-shadow: 0 2px 10px rgba(255, 193, 7, 0.4);
        }

        /* v11.5.3: SECURITY-01 - État device bloqué */
        body.device-blocked {
            pointer-events: none;
            opacity: 0.6;
        }

        body.device-blocked::before {
            content: '🚫 APPAREIL BLOQUÉ PAR UN ADMINISTRATEUR';
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
            color: white;
            padding: 16px 20px;
            text-align: center;
            font-weight: 700;
            font-size: 1.1rem;
            z-index: 99999;
            box-shadow: 0 4px 20px rgba(211, 47, 47, 0.6);
            pointer-events: auto;
        }
