/* ========================================
   BB BOUGE - Module Remplacements
   Styles spécifiques
   ======================================== */

/* === CALENDRIER === */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    background-color: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    width: 100%;
    min-width: 0;
}

.calendar-header {
    background-color: #2D5F7C;
    color: white;
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.calendar-day {
    background-color: white;
    min-height: 80px;
    padding: 8px;
    position: relative;
    transition: all 0.2s;
    overflow: hidden;
    min-width: 0;
}

.calendar-day:hover {
    background-color: #FFF8F5;
}

.calendar-day.empty {
    background-color: #f9fafb;
}

.calendar-day.weekend {
    background-color: #f3f4f6;
}

.calendar-day.jour-repos {
    background-color: #FFF8F5;
    border: 2px solid #F4845F;
}

.calendar-day.jour-repos:hover {
    background-color: #FFEDE5;
}

.calendar-day.past {
    opacity: 0.5;
    pointer-events: none;
}

.calendar-day.today {
    box-shadow: inset 0 0 0 2px #F4845F;
}

.calendar-day-number {
    font-weight: 600;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 4px;
}

.calendar-day.jour-repos .calendar-day-number {
    color: #F4845F;
}

/* === BADGES DISPONIBILITÉ === */
.dispo-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-top: 2px;
}

.dispo-badge.matin {
    background-color: #DBEAFE;
    color: #1E40AF;
}

.dispo-badge.aprem {
    background-color: #FEF3C7;
    color: #92400E;
}

.dispo-badge.journee {
    background-color: #D1FAE5;
    color: #065F46;
}

/* === BOUTONS CRÉNEAU === */
.creneau-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 12px;
    border: 2px solid #e5e7eb;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.creneau-btn:hover {
    border-color: #F4845F;
    background-color: #FFF8F5;
}

.creneau-btn.selected {
    border-color: #F4845F;
    background-color: #F4845F;
    color: white;
}

.creneau-btn.selected:hover {
    background-color: #E5734E;
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

/* === TABLEAU ADMIN === */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background-color: #f9fafb;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.admin-table tr:hover {
    background-color: #FFF8F5;
}

/* === STATS CARDS === */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #F4845F;
}

.stat-card .stat-label {
    color: #6b7280;
    font-size: 0.875rem;
    margin-top: 4px;
}

/* === FILTRES === */
.filter-btn {
    padding: 8px 16px;
    border-radius: 9999px;
    border: 2px solid #e5e7eb;
    background: white;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
}

.filter-btn:hover {
    border-color: #F4845F;
}

.filter-btn.active {
    background-color: #F4845F;
    border-color: #F4845F;
    color: white;
}

/* === CRÈCHE BADGES === */
.creche-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.creche-badge.p13 {
    background-color: rgba(244, 132, 95, 0.2);
    color: #F4845F;
}

.creche-badge.p15 {
    background-color: rgba(45, 95, 124, 0.2);
    color: #2D5F7C;
}

/* === ALERTES === */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 16px;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #6BCB77;
}

.alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #F87171;
}

.alert-info {
    background-color: #DBEAFE;
    color: #1E40AF;
    border: 1px solid #60A5FA;
}

.alert-warning {
    background-color: #FEF3C7;
    color: #92400E;
    border: 1px solid #FBBF24;
}

/* === FORMULAIRES === */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: #F4845F;
    box-shadow: 0 0 0 3px rgba(244, 132, 95, 0.1);
}

.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
}

.form-select:focus {
    outline: none;
    border-color: #F4845F;
}

/* === NAVIGATION MODULE (ancien header - masqué) === */
.module-nav {
    display: none !important;
}

/* ========================================
   SIDEBAR NAVIGATION
   ======================================== */

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 240px;
    background: white;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    z-index: 60;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 20px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.sidebar-logo a {
    text-decoration: none;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 0;
    overflow-y: auto;
}

.sidebar-section {
    padding: 4px 0;
}

.sidebar-section-title {
    padding: 12px 20px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9ca3af;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.15s ease;
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background-color: #FFF8F5;
    color: #F4845F;
}

.sidebar-link.active {
    background-color: #FFF8F5;
    color: #F4845F;
    border-left-color: #F4845F;
    font-weight: 600;
}

.sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    stroke-width: 2;
}

.sidebar-link.active .sidebar-icon {
    stroke: #F4845F;
}

.sidebar-user {
    padding: 12px 16px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fafafa;
}

.sidebar-logout {
    padding: 6px;
    border-radius: 8px;
    color: #9ca3af;
    transition: all 0.15s;
    flex-shrink: 0;
}

.sidebar-logout:hover {
    background-color: #fee2e2;
    color: #ef4444;
}

.sidebar-main {
    margin-left: 240px;
    min-height: 100vh;
}

/* === MOBILE TOPBAR === */
.sidebar-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0 16px;
    align-items: center;
    justify-content: space-between;
    z-index: 50;
}

.sidebar-hamburger {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #374151;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-hamburger:hover {
    background-color: #f3f4f6;
}

/* === OVERLAY === */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 55;
    opacity: 0;
    transition: opacity 0.3s;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* === AVATAR === */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F4845F 0%, #F9A882 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.avatar.small {
    width: 32px;
    height: 32px;
    font-size: 0.875rem;
}

.avatar.large {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
}

/* === RESPONSIVE === */
@media (max-width: 1023px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-topbar {
        display: flex;
    }

    .sidebar-main {
        margin-left: 0;
        padding-top: 56px;
        overflow-x: hidden;
        max-width: 100vw;
    }

    .sidebar-overlay {
        display: none;
    }

    .sidebar-overlay.active {
        display: block;
    }
}

@media (max-width: 768px) {
    .calendar-grid {
        font-size: 0.65rem;
        gap: 1px;
        border-radius: 8px;
    }
    
    .calendar-day {
        min-height: 40px;
        padding: 2px;
    }
    
    .calendar-header {
        padding: 4px 1px;
        font-size: 0.6rem;
    }
    
    .calendar-day-number {
        font-size: 0.65rem;
        margin-bottom: 0;
    }
    
    .dispo-badge {
        font-size: 0.5rem;
        padding: 0 2px;
    }
    
    /* Empêcher tout débordement */
    .planning-layout,
    .planning-main,
    .planning-sidebar,
    .bg-white {
        min-width: 0;
        max-width: 100%;
    }
    
    .planning-sidebar .font-poppins {
        font-size: 0.9rem;
        word-break: break-word;
    }
}

/* === LOADING === */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    border-top-color: #F4845F;
    animation: spin 0.8s linear infinite;
}

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

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}
