*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        :root {
            /*--primary:    #3b82f6;*/
            --primary:    #838383;
            --primary-dk: #e5002c;
            --success:    #10b981;
            --danger:     #ef4444;
            --warning:    #f59e0b;
            --dark:       #1e293b;
            --gray:       #64748b;
            --light:      #f1f5f9;
            --white:      #ffffff;
            --border:     #e2e8f0;
            --rouge-fonce : #aa0d12;
            --shadow:     0 4px 24px rgba(0,0,0,0.10);
            --radius:     12px;
        }

        body {
            font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
            background: #f7f7f7;
            min-height: 100vh;
            color: var(--dark);
        }

        /* ── Header ── */
        .header {
            background: linear-gradient(135deg, var(--white), var(--primary-dk));
            backdrop-filter: blur(10px);
            /*border-bottom: 1px solid rgba(255,255,255,0.1);*/
            padding: 16px 32px;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .header-logo {
            font-size: 1.4rem;
            font-weight: 700;
            color: var(--white);
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .header-info {
            display: flex;
            align-items: center;
            gap: 16px;
            color: rgba(255,255,255,0.7);
            font-size: 0.9rem;
        }

        .btn-logout {
            padding: 8px 18px;
            background: #FFF;
            color: var(--primary-dk);
            border: 1px solid rgba(239,68,68,0.3);
            border-radius: 8px;
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 600;
            transition: all 0.2s;
        }

        .btn-logout:hover {
            /*background: rgba(239,68,68,0.3);*/
            background: #FFF;
            color: var(--primary-dk);
        }

        /* ── Container ── */
        .container {
            max-width: 1200px;
            margin: 40px auto;
            padding: 0 20px;
        }

        /* ── Login Card ── */
        .login-card {
            max-width: 420px;
            margin: 80px auto;
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: hidden;
        }

        .login-header {
            /*background: linear-gradient(180deg, var(--white), var(--primary-dk));*/
            background: white;
            border-bottom: 1px solid rgba(204, 30, 30, 0.671);
            padding: 32px;
            text-align: center;
            color: #000;
        }

        .login-header h1 { font-size: 1.6rem; margin-top: 12px; }
        .login-header p  { font-size: 0.9rem; opacity: 0.85; margin-top: 6px; }

        .login-body { padding: 32px; }

        .form-group { margin-bottom: 20px; }

        .form-label {
            display: block;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--gray);
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .form-control {
            width: 100%;
            padding: 12px 16px;
            border: 2px solid var(--border);
            border-radius: 8px;
            font-size: 0.95rem;
            color: var(--dark);
            background: var(--light);
            transition: border-color 0.2s, box-shadow 0.2s;
            outline: none;
        }

        .form-control:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
            background: white;
        }

        .btn-login {
            width: 100%;
            padding: 14px;
            background: linear-gradient(135deg, #b13131, var(--primary-dk));
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s;
            letter-spacing: 0.5px;
        }

        .btn-login:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(59,130,246,0.4);
        }

        .btn-login:active { transform: translateY(0); }

        /* ── Alertes ── */
        .alert {
            padding: 12px 16px;
            border-radius: 8px;
            margin-bottom: 20px;
            font-size: 0.9rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .alert-danger  { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
        .alert-success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
        .alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

        /* ── Explorateur FTP ── */
        .ftp-panel {
            background: var(--white);
            border-radius: var(--radius);
            box-shadow: var(--shadow);
            overflow: hidden;
        }

        .ftp-toolbar {
            background: var(--light);
            border-bottom: 1px solid var(--border);
            padding: 16px 24px;
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: wrap;
        }

        /* ── Breadcrumb ── */
        .breadcrumb {
            display: flex;
            align-items: center;
            gap: 6px;
            flex: 1;
            min-width: 0;
            flex-wrap: wrap;
        }

        .breadcrumb-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 0.9rem;
        }

        .breadcrumb-item a {
            color: var(--primary);
            text-decoration: none;
            font-weight: 500;
            padding: 4px 8px;
            border-radius: 6px;
            transition: background 0.2s;
        }

        .breadcrumb-item a:hover { background: rgba(59,130,246,0.1); }

        .breadcrumb-item.active {
            color: var(--dark);
            font-weight: 600;
            padding: 4px 8px;
        }

        .breadcrumb-sep { color: var(--gray); font-size: 0.8rem; }

        /* ── Tableau ── */
        .ftp-table {
            width: 100%;
            border-collapse: collapse;
        }

        .ftp-table thead {
            background: #ebebeb;
            color:#000;
        }

        .ftp-table thead th {
            padding: 14px 20px;
            text-align: left;
            font-size: 0.8rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.8px;
        }

        .ftp-table tbody tr {
            border-bottom: 1px solid var(--border);
            transition: background 0.15s;
        }

        .ftp-table tbody tr:last-child { border-bottom: none; }
        .ftp-table tbody tr:hover      { background: #f8fafc; }

        .ftp-table td {
            padding: 13px 20px;
            font-size: 0.9rem;
            vertical-align: middle;
        }

        .link-dir {
            color: #000;
            text-decoration: none;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
            transition: color 0.2s;
        }

        .link-dir:hover { color: #d97706; }

        .file-name {
            display: flex;
            align-items: center;
            gap: 8px;
            color: var(--dark);
            font-weight: 500;
        }

        .badge-type {
            padding: 2px 10px;
            border-radius: 20px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .badge-dir  { background: #fef3c7; color: #92400e; }
        .badge-file { background: #e0f2fe; color: #0369a1; }

        .permissions {
            font-family: 'Courier New', monospace;
            font-size: 0.8rem;
            color: var(--gray);
            background: var(--light);
            padding: 3px 8px;
            border-radius: 4px;
        }

        .size-text { color: var(--gray); font-size: 0.85rem; }

        /* ── Boutons d'action ── */
        .btn-download {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 7px 14px;
            /*background: linear-gradient(135deg, var(--primary), var(--primary-dk));*/
            background: #dadada;
            color: #000;
            border-radius: 7px;
            text-decoration: none;
            font-size: 0.8rem;
            font-weight: 600;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .btn-download:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px var(--primary);
        }

        .btn-open {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 7px 14px;
            /*background: linear-gradient(135deg, #ed8d8d, var(--primary-dk));*/
            background: #dadada;
            color: #000;
            border-radius: 7px;
            text-decoration: none;
            font-size: 0.8rem;
            font-weight: 600;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .btn-open:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px var(--primary);
        }

        /* ── Stats bar ── */
        .stats-bar {
            background: var(--light);
            border-top: 1px solid var(--border);
            padding: 12px 24px;
            display: flex;
            gap: 24px;
            font-size: 0.85rem;
            color: var(--gray);
        }

        .stats-bar span { font-weight: 700; color: var(--dark); }

        /* ── Empty state ── */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: var(--gray);
        }

        .empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }
        .empty-state p           { font-size: 0.95rem; }

        /* ── Liens de tri ── */
.sort-link {
    color: inherit;
    text-decoration: none;
    /*display: flex;*/
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    white-space: nowrap;
    transition: opacity 0.2s;
    user-select: none;
    padding: 4px 0;
}

.sort-link:hover {
    opacity: 0.75;
}

.sort-link.sort-active {
    color: var(--primary-dk);
}

.sort-icon {
    font-size: 0.8rem;
    display: inline-block;
    margin-left: 4px;
}

/* Indicateur de tri secondaire */
.sort-secondary-hint {
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.6;
    font-style: italic;
    color: #94a3b8;
}

.sort-link.sort-active .sort-secondary-hint {
    color: #7dd3fc;
}

thead th {
    cursor: pointer;
    vertical-align: top;
}

thead th:nth-child(2),   /* Permissions */
thead th:last-child {    /* Action */
    cursor: default;
}

.user-icon {
    filter: brightness(0) invert(1);
}


        /* ── Responsive ── */
        @media (max-width: 768px) {
            .ftp-table thead th:nth-child(3),
            .ftp-table td:nth-child(3),
            .ftp-table thead th:nth-child(4),
            .ftp-table td:nth-child(4) { display: none; }

            .header { padding: 12px 16px; }
            .container { margin: 20px auto; }
        }