body {
    background: var(--bg-cyan-gradient);
    justify-content: flex-start;
    flex-direction: column;
    overflow-y: auto;
}

.accueil-layout {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.nav-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    padding: 20px 0;
    border-bottom: 1px solid rgba(13, 229, 214, 0.1);
}

.brand {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--cyan);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-name {
    font-size: 0.9rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.role-badge {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-weight: 600;
}

/* Super admin : ROUGE */
.role-badge.super_admin {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.35);
}

/* Admin : ORANGE */
.role-badge.admin,
.role-badge.badge-manager {
    background: rgba(249, 115, 22, 0.15);
    color: #fb923c;
    border-color: rgba(249, 115, 22, 0.35);
}

/* Collaborateur : JAUNE */
.role-badge.collaborateur,
.role-badge.badge-subadmin {
    background: rgba(234, 179, 8, 0.15);
    color: #facc15;
    border-color: rgba(234, 179, 8, 0.35);
}

/* Utilisateur : BLEU CIEL */
.role-badge.user {
    background: rgba(13, 229, 214, 0.1);
    color: var(--cyan);
    border-color: rgba(13, 229, 214, 0.3);
}

.btn-cyan {
    background: var(--cyan);
    color: #0d121f;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    font-size: 0.9rem;
}

.btn-cyan:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 229, 214, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--cyan);
    border: 1px solid var(--cyan);
    padding: 10px 20px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.btn-outline:hover {
    background: rgba(13, 229, 214, 0.1);
    transform: translateY(-2px);
}

.welcome-section {
    margin-bottom: 40px;
}

.welcome-section h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.welcome-section p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.machine-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.machine-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    overflow: hidden;
    transition: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.machine-card:hover {
    transform: translateY(-10px);
    border-color: var(--cyan);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(13, 229, 214, 0.1);
}

.machine-thumb {
    width: 100%;
    height: 220px;
    background-size: cover;
    background-position: center;
    position: relative;
    transition: 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.machine-card:hover .machine-thumb {
    transform: scale(1.05);
}

.machine-thumb::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(10, 17, 32, 0.8), transparent);
}

.machine-content {
    padding: 25px;
    position: relative;
    z-index: 1;
}

.machine-content h3 {
    font-size: 1.3rem;
    margin-bottom: 5px;
    color: white;
    transition: 0.3s;
}

.machine-card:hover .machine-content h3 {
    color: var(--cyan);
}

.creator-info {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.creator-name {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
}

.admin-badge {
    background: rgba(96, 165, 250, 0.1);
    color: #60a5fa;
    border: 1px solid rgba(96, 165, 250, 0.2);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.relative-date {
    font-size: 0.75rem;
    opacity: 0.5;
}

.machine-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 20px;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.view-badge {
    font-size: 0.75rem;
    color: var(--cyan);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    transition: 0.3s;
}

.machine-card:hover .view-badge {
    transform: translateX(5px);
}

.status-pill {
    padding: 4px 12px;
    background: rgba(13, 229, 214, 0.1);
    border: 1px solid rgba(13, 229, 214, 0.2);
    border-radius: 20px;
    font-size: 0.7rem;
    color: var(--cyan);
    backdrop-filter: blur(5px);
}

/* Loading state */
#loader {
    display: flex;
    justify-content: center;
    padding: 50px;
    width: 100%;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(13, 229, 214, 0.2);
    border-top: 3px solid var(--cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .accueil-layout {
        padding: 20px 15px;
    }

    .nav-bar {
        flex-direction: column;
        gap: 20px;
        margin-bottom: 30px;
        padding: 15px 0;
        text-align: center;
    }

    .auth-info {
        flex-direction: column;
        width: 100%;
        gap: 12px;
    }

    .welcome-section {
        text-align: center;
        margin-bottom: 30px;
    }

    .welcome-section h1 {
        font-size: 1.8rem;
    }

    .welcome-section p {
        font-size: 1rem;
    }

    .machine-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .machine-thumb {
        height: 180px;
    }

    .machine-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .welcome-section h1 {
        font-size: 1.5rem;
    }

    .btn-cyan, .btn-outline {
        width: 100%;
        padding: 12px 20px;
        display: flex;
        justify-content: center;
    }

    .auth-info > div {
        justify-content: center;
        width: 100%;
    }

    .machine-thumb {
        height: 160px;
    }

    .user-name {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .card-header {
        flex-wrap: wrap;
        gap: 8px;
    }
}

/* Footer Accueil */
.accueil-footer {
    margin-top: 60px;
    padding: 24px 0 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    width: 100%;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-brand {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0.5px;
}

.footer-version-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    background: rgba(13, 229, 214, 0.08);
    border: 1px solid rgba(13, 229, 214, 0.25);
    color: var(--cyan);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.5px;
    box-shadow: 0 0 10px rgba(13, 229, 214, 0.05);
}