/* Layout CSS corrigé - Une seule solution qui fonctionne */

/* Reset complet pour éviter les conflits */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* App Container - Layout principal */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
    background: var(--bg-primary);
    color: var(--text-primary);
    position: relative;
}

/* Sidebar - Fixe à gauche */
.sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.app-header {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.app-logo {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: center;
    width: 100%;
}

.logo-image {
    height: 100px;
    width: auto;
    max-width: 220px;
    filter: brightness(0) invert(1); /* Rend l'image blanche */
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.logo-image:hover {
    opacity: 1;
}

/* Ancien service-selector dans app-header supprimé */

.service-btn {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.9rem;
}

.service-btn.active {
    background: var(--primary);
    color: var(--text-primary);
    border-color: var(--primary);
}

.service-btn:hover:not(.active) {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.date-info {
    text-align: center;
    padding: 0.75rem;
    background: var(--bg-card);
    margin: 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.date-with-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.current-date {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    flex: 1;
    text-align: center;
}

.date-info .service-selector {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.date-nav-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.date-nav-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.nav-menu {
    flex: 1;
    padding: 0.5rem 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-item {
    display: block;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.nav-item:hover, .nav-item.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

/* Main Content - Décalé de la largeur de la sidebar */
.main-content {
    margin-left: 280px;
    width: calc(100vw - 280px);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Pages */
.page {
    display: none;
    height: 100%;
    width: 100%;
    overflow: auto;
}

.page.active {
    display: flex;
    flex-direction: column;
}

/* Dashboard spécifique */
.dashboard-page {
    padding: 2rem;
    gap: 2rem;
}

.page-content {
    padding: 2rem;
    flex: 1;
    overflow: auto;
}

.page-content h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* FAB */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.fab:active {
    transform: scale(0.95);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1000;
        height: 100vh;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        width: 100vw;
        margin-left: 0;
    }
}