/* --- Grille de la Résidence --- */
.residence-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Adaptatif */
    gap: 20px; 
    margin-top: 20px;
    align-items: start;
}

.bloc-card { 
    background: #fff; 
    border-radius: 10px; 
    border: 1px solid #e2e8f0; 
    padding: 20px;
    border-top: 4px solid #0f172a;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.floor-box { 
    border-bottom: 1px solid #f1f5f9; 
    padding: 12px 0; 
}

/* Empêche le débordement des chambres */
.room-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr)); /* S'adapte à la largeur du bloc */
    gap: 10px; 
    margin-top: 10px;
}



.room-unit { 
    aspect-ratio: 1/1; 
    border-radius: 6px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 0.75rem; 
    font-weight: 600; 
    transition: all 0.2s ease;
    border: 1px solid rgba(0,0,0,0.05);
}

.room-unit:hover { 
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    filter: brightness(0.9);
}

/* --- Système d'Onglets (Tabs) --- */
.tabs-nav { 
    display: flex; 
    border-bottom: 2px solid #e2e8f0; 
    margin-bottom: 20px; 
    gap: 10px;
}

.tab-item { 
    padding: 12px 20px; 
    cursor: pointer; 
    font-weight: 600; 
    color: #64748b; 
    border-bottom: 3px solid transparent;
    transition: 0.3s;
}

.tab-item.active { 
    color: #0284c7; 
    border-bottom-color: #0284c7; 
}

.tab-pane { display: none; padding: 10px 0; }
.tab-pane.active { display: block; }

/* --- Modal (Correction du chevauchement) --- */
.m-modal { 
    display: none; 
    position: fixed; 
    z-index: 2000; /* Supérieur à la sidebar du dashboard */
    left: 0; 
    top: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(15, 23, 42, 0.6); 
    backdrop-filter: blur(4px); 
}

.m-content { 
    background: white; 
    margin: 5% auto; 
    width: 90%; 
    max-width: 450px; 
    border-radius: 16px; 
    overflow: hidden; 
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.m-header { padding: 1.2rem; background: #0f172a; color: white; display: flex; justify-content: space-between; align-items: center; }
.m-body { padding: 1.5rem; color: #1e293b; line-height: 1.6; }
.m-badge { 
    background: #f1f5f9; 
    padding: 4px 10px; 
    border-radius: 8px; 
    font-size: 0.8rem; 
    margin: 3px; 
    display: inline-block; 
    border: 1px solid #e2e8f0;
}

/* --- Conteneur de page avec marges --- */
.page-container {
    padding: 20px 40px; /* Marges gauche/droite de 40px */
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Design des Formulaires --- */
.card-pro {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    padding: 30px;
    border: 1px solid #e2e8f0;
}

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s;
    background: #f8fafc;
}

.form-control:focus {
    outline: none;
    border-color: #0284c7;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(2, 132, 199, 0.1);
}

/* --- Tabs (Onglets) --- */
.tabs-nav {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 25px;
}

.tab-item {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    border-bottom: 3px solid transparent;
    transition: 0.3s;
}

.tab-item.active {
    color: #0284c7;
    border-bottom-color: #0284c7;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }