* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #F9F9F9;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.navbar {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
}

.nav-menu {
    display: flex;
    gap: 1.5rem;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.nav-menu a:hover {
    background-color: #34495e;
}

.main-content {
    margin-top: 2rem;
    min-height: calc(100vh - 100px);
}

.section {
    display: none;
}

.section.active {
    display: block;
}

.login-container {
    max-width: 400px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
    width: 100%;
    display: block;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group label[style*="display: flex"] {
    margin-left: 0 !important;
    padding-left: 0 !important;
    align-items: center;
    width: 100% !important;
    max-width: 100% !important;
}

.form-group input,
.form-group select,
.form-control {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.75rem;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box !important;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-primary {
    background-color: #8BC34A;
    color: white;
}

.btn-primary:hover {
    background-color: #7CB342;
}

.btn-secondary {
    background-color: #E0E0E0;
    color: #8BC34A;
}

.btn-secondary:hover {
    background-color: #D5D5D5;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.dashboard-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dashboard-card h3 {
    margin-bottom: 1rem;
    color: #8BC34A;
}

.view-toggle-container {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.5rem;
}

.view-toggle-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.month-selector {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 0 2rem 0;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.view-toggle-btn {
    padding: 0.3rem 0.5rem;
    background-color: #e0e0e0;
    color: #666;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn:hover {
    background-color: #d0d0d0;
    transform: scale(1.05);
}

.view-toggle-btn.active {
    background-color: #8BC34A;
    color: white;
    box-shadow: 0 2px 4px rgba(139, 195, 74, 0.3);
}

.view-toggle-btn:active {
    transform: scale(0.98);
}

.month-selector button {
    padding: 0.5rem 1rem;
    background-color: #8BC34A;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.month-selector button:hover {
    background-color: #7CB342;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.calendar-day {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 150px;
}

.calendar-day h4 {
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.meal-item {
    background-color: #e3f2fd;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #E0E0E0;
}

.table th {
    background-color: #8BC34A;
    color: white;
    font-weight: 600;
}

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

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #7f8c8d;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 1000;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box !important;
    min-width: 0;
}

.modal-content.modal-large {
    max-width: 700px !important;
}

/* Force all form elements to use full width - très spécifique pour override Tailwind */
.modal-content form {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.modal-content form .form-group {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.modal-content form input[type="text"],
.modal-content form input[type="email"],
.modal-content form input[type="time"],
.modal-content form input[type="number"],
.modal-content form textarea,
.modal-content form select {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.modal-content form label {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}

.modal-content form small {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
}

.modal-content input,
.modal-content textarea,
.modal-content select,
.modal-content label,
.modal-content .form-group {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.modal-content.modal-large {
    max-width: 700px;
}

.modal-content form {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    padding: 0 !important;
}

.modal-content .form-group {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

.modal-content .form-group input,
.modal-content .form-group textarea,
.modal-content .form-group select {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
}

.modal-content .form-group label {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.modal-content .form-group label[style*="display: flex"] {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    align-items: center;
    box-sizing: border-box !important;
}

.modal-content .form-group label[style*="display: flex"] span {
    flex: 1;
    min-width: 0;
    display: block;
}

.modal-content small {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: block !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.modal-content button {
    box-sizing: border-box;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #7f8c8d;
}

.close-modal:hover {
    color: #2c3e50;
}

.admin-container {
    display: flex;
    gap: 2rem;
    min-height: calc(100vh - 200px);
    margin-top: 2rem;
    padding-top: 1rem;
}

.admin-sidebar {
    width: 250px;
    flex-shrink: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem 0;
}

.admin-sidebar-title {
    padding: 0 1.5rem 1.5rem 1.5rem;
    margin: 0 0 1rem 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    border-bottom: 2px solid #eee;
}

.admin-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0 0.5rem;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    color: #666;
    text-align: left;
    transition: all 0.3s;
    border-radius: 4px;
}

.admin-tab:hover {
    color: #2c3e50;
    background-color: #f5f5f5;
}

.admin-tab.active {
    color: #8BC34A;
    border-left-color: #8BC34A;
    background-color: #ECF7E6;
    font-weight: 600;
}

.admin-content-wrapper {
    flex: 1;
    min-width: 0;
}

/* Styles pour les sous-onglets de Paramètres dans la sidebar */
.admin-parametres-subtabs-wrapper,
.admin-cartes-repas-subtabs-wrapper,
.admin-commandes-subtabs-wrapper,
.admin-produits-subtabs-wrapper,
.admin-ecoles-subtabs-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem 0 0.5rem 1.5rem;
    margin-top: 0.25rem;
    border-left: 2px solid #e0e0e0;
}

.admin-parametres-subtab,
.admin-cartes-repas-subtab,
.admin-commandes-subtab,
.admin-produits-subtab,
.admin-ecoles-subtab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    color: #666;
    text-align: left;
    transition: all 0.3s;
    border-radius: 4px;
    margin-left: 0.5rem;
}

.admin-parametres-subtab:hover,
.admin-cartes-repas-subtab:hover,
.admin-commandes-subtab:hover,
.admin-produits-subtab:hover,
.admin-ecoles-subtab:hover {
    color: #2c3e50;
    background-color: #f5f5f5;
}

.admin-parametres-subtab.active,
.admin-cartes-repas-subtab.active,
.admin-commandes-subtab.active,
.admin-produits-subtab.active,
.admin-ecoles-subtab.active {
    color: #8BC34A;
    border-left-color: #8BC34A;
    background-color: #ECF7E6;
    font-weight: 600;
}

.admin-parametres-content,
.admin-cartes-repas-content,
.admin-commandes-content {
    width: 100%;
}

/* Responsive pour la section admin */
@media (max-width: 768px) {
    .admin-container {
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
        padding-top: 0.5rem;
    }
    
    .admin-sidebar {
        width: 100%;
        padding: 1rem 0;
    }
    
    .admin-sidebar-title {
        padding: 0 1rem 1rem 1rem;
        font-size: 1.25rem;
    }
    
    .admin-tabs {
        flex-direction: row;
        overflow-x: auto;
        padding: 0 0.5rem;
        gap: 0.5rem;
        -webkit-overflow-scrolling: touch;
    }
    
    .admin-tab {
        padding: 0.5rem 1rem;
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
        flex-shrink: 0;
    }
    
    .admin-tab.active {
        border-left: none;
        border-bottom-color: #3498db;
    }
    
    .admin-parametres-subtabs-wrapper,
    .admin-cartes-repas-subtabs-wrapper,
    .admin-commandes-subtabs-wrapper,
    .admin-produits-subtabs-wrapper,
    .admin-ecoles-subtabs-wrapper {
        padding-left: 1rem;
        margin-left: 0.5rem;
    }
    
    .admin-parametres-subtab,
    .admin-cartes-repas-subtab,
    .admin-commandes-subtab,
    .admin-produits-subtab,
    .admin-ecoles-subtab {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

textarea {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    box-sizing: border-box !important;
}

small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.875rem;
}

.jours-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.jours-checkboxes label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

.jours-checkboxes input[type="checkbox"] {
    width: auto;
    margin: 0;
}

input[type="file"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#imagePreview img,
#editImagePreview img {
    border: 2px solid #ddd;
    padding: 5px;
}

/* Styles pour le menu mensuel en grille */
.menu-calendar-grid {
    margin-top: 1rem;
}

.calendar-week-header-menu {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.calendar-day-header-menu {
    padding: 1rem;
    background-color: #8BC34A;
    color: white;
    text-align: center;
    font-weight: 600;
    border-radius: 8px 8px 0 0;
}

.calendar-week-grid-menu {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
}

.calendar-day-cell-menu {
    background: white;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1rem;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.calendar-day-cell-menu.empty {
    background: transparent;
    box-shadow: none;
    border: none;
}

.day-number-menu {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.day-name-menu {
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.day-meals-menu {
    flex: 1;
    /* Laisse les cartes grandir en fonction du texte, évite le rognage interne */
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

/* Alignement des blocs de repas pour que tous les sandwichs soient alignés */
.day-meals-menu .meal-card-full:first-child {
    flex-shrink: 0;
}

.day-meals-menu .meal-card-full {
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    /* Taille basée sur le contenu pour ne pas couper le texte */
    flex: 0 0 auto;
}

.day-meals-menu .meal-card-image-full {
    height: 150px;
}

.day-meals-menu .meal-card-content-full {
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    /* Occupe l'espace restant dans la carte pour pousser le bouton en bas */
    flex: 1 0 auto;
}

.day-meals-menu .meal-card-date {
    font-size: 0.9rem;
}

.day-meals-menu .meal-card-type {
    font-size: 0.8rem;
}

.day-meals-menu .meal-card-variants-full {
    font-size: 0.85rem;
}

.day-meals-menu .accompaniment-item {
    font-size: 0.8rem;
}

.day-meals-menu .meal-card-details-full {
    flex: 1;
    min-height: 0;
}

.day-meals-menu .btn-select-full {
    padding: 0.5rem;
    font-size: 0.85rem;
    margin-top: auto;
    flex-shrink: 0;
}

.no-meals-day {
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
    padding: 1rem;
    text-align: center;
}

/* Responsive pour le calendrier menu */
@media (max-width: 1200px) {
    .calendar-week-header-menu,
    .calendar-week-grid-menu {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.75rem;
    }
    
    .calendar-day-cell-menu {
        min-height: 350px;
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .calendar-week-header-menu,
    .calendar-week-grid-menu {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .calendar-day-cell-menu {
        min-height: auto;
    }
}

/* Styles pour le calendrier simple (commandes uniquement) */
.calendar-simple {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.calendar-day-simple {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calendar-day-simple h4 {
    margin-bottom: 0.75rem;
    color: #2c3e50;
    font-size: 1.1rem;
}

.commande-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: #e8f5e9;
    border-left: 3px solid #4caf50;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.commande-enfant {
    font-weight: 600;
    color: #2c3e50;
}

.commande-repas {
    font-size: 0.9rem;
    color: #666;
}

.no-commandes {
    color: #999;
    font-size: 0.9rem;
    font-style: italic;
    padding: 0.5rem;
}

/* Styles pour les cartes de repas complètes dans le calendrier */
.meals-list-container {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.meal-card-full {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.meal-card-image-full {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.meal-card-image-full img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.meal-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e9ecef;
    color: #6c757d;
    font-size: 0.9rem;
}

.meal-card-content-full {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.meal-card-header-full {
    margin-bottom: 1rem;
}

.meal-card-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.meal-card-date-subtitle {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

.meal-card-date {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
    line-height: 1.3;
}

.meal-card-details-full {
    flex: 1;
    margin-bottom: 1.5rem;
    min-height: 0;
}

.meal-card-type {
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
}

.meal-card-variants-full {
    font-size: 0.95rem;
    font-weight: 600;
    color: #3498db;
    margin-bottom: 0.75rem;
}

.meal-card-description {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-top: 0.5rem;
}

.meal-card-description strong,
.meal-card-description b {
    font-weight: 700;
}

.meal-card-description em,
.meal-card-description i {
    font-style: italic;
}

.meal-card-description span[style*="font-size"] {
    display: inline-block;
}

.meal-card-accompaniments {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.accompaniment-item {
    font-size: 0.9rem;
    color: #2c3e50;
    line-height: 1.4;
}

.meal-card-loading {
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
}

.btn-select-full {
    width: 100%;
    padding: 0.75rem;
    background-color: white;
    color: #2c3e50;
    border: 1px solid #2c3e50;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: auto;
}

.btn-select-full:hover {
    background-color: #2c3e50;
    color: white;
}

/* Responsive pour les cartes complètes */
@media (max-width: 768px) {
    .meal-card-image-full {
        height: 200px;
    }
    
    .meal-card-content-full {
        padding: 1rem;
    }
}

.calendar-meals {
    margin-top: 10px;
}

.meals-ordered,
.meals-available {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.meals-ordered strong,
.meals-available strong {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
    color: #2c3e50;
}

.meal-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.meal-item.ordered {
    background-color: #e8f5e9;
    border-left: 3px solid #4caf50;
}

.meal-item.available {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
    justify-content: space-between;
}

.meal-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meal-price {
    font-size: 0.85rem;
    color: #666;
    font-weight: 600;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Calendrier mensuel en grille */
.calendar-grid {
    width: 100%;
    margin-top: 1rem;
}

.calendar-week-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    margin-bottom: 5px;
    font-weight: bold;
}

.calendar-day-header {
    padding: 0.75rem;
    background-color: #8BC34A;
    color: white;
    text-align: center;
    border-radius: 4px;
    font-size: 0.9rem;
}

.calendar-week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.calendar-day-cell {
    min-height: 150px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 0.5rem;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
}

.calendar-day-cell.empty {
    background-color: #f5f5f5;
    border: none;
}

.day-number {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.day-meals {
    flex: 1;
    overflow-y: auto;
    max-height: 120px;
}

.meal-item-compact {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 5px;
    margin-bottom: 5px;
    background-color: white;
    border-radius: 4px;
    font-size: 0.8rem;
}

.meal-image-small {
    width: 100%;
    max-width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    margin: 0 auto;
}

.meal-info-compact {
    text-align: center;
}

.meal-name-small {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.meal-price-small {
    display: block;
    font-size: 0.7rem;
    color: #666;
    font-weight: 600;
}

.no-meals {
    font-size: 0.75rem;
    color: #999;
    text-align: center;
    margin: 0.5rem 0;
    font-style: italic;
}

/* Responsive pour petits écrans */
@media (max-width: 768px) {
    .calendar-week-header,
    .calendar-week-grid {
        grid-template-columns: repeat(7, 1fr);
        gap: 2px;
    }
    
    .calendar-day-header {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
    }
    
    .calendar-day-cell {
        min-height: 120px;
        padding: 0.25rem;
    }
    
    .meal-name-small {
        font-size: 0.65rem;
    }
    
    .btn-xs {
        padding: 0.2rem 0.4rem;
        font-size: 0.65rem;
    }
}

/* Styles pour la section compte */
.compte-container {
    max-width: 800px;
    margin: 0 auto;
}

/* Masquer le titre de page placé en tête de section (ex. Menu Mensuel) */
.section > h2:first-child {
    display: none !important;
}

.compte-section {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.compte-section h3 {
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.compte-section h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: #34495e;
}

.required {
    color: #e74c3c;
}

/* Styles pour la liste des enfants */
#enfantsListCompte {
    margin-bottom: 2rem;
}

.enfant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.enfant-item:hover {
    background-color: #e9ecef;
    border-color: #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.enfant-info {
    flex: 1;
}

.enfant-info strong {
    display: block;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.enfant-details {
    display: flex;
    gap: 1.5rem;
    font-size: 0.9rem;
    color: #6c757d;
}

.enfant-details span {
    display: flex;
    align-items: center;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-danger {
    background-color: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

/* Responsive pour la section compte */
@media (max-width: 768px) {
    .compte-section {
        padding: 1rem;
    }
    
    .enfant-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .enfant-details {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* Styles pour le panier latéral */
.panier-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.panier-sidebar.open {
    right: 0;
}

.panier-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--tg-slate);
    color: white;
}

.panier-sidebar-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.panier-close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.panier-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.panier-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.panier-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #6b7280;
    font-size: 1.1rem;
}

.panier-item {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 0.5rem;
}

.panier-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.5rem;
}

.panier-item-name {
    font-weight: 600;
    color: var(--tg-ink);
    flex: 1;
}

.panier-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.panier-item-remove:hover {
    color: #dc2626;
}

.panier-item-details {
    font-size: 0.9rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.panier-item-details div {
    margin-bottom: 0.25rem;
}

.panier-item-price {
    font-weight: 600;
    color: var(--tg-accent);
    text-align: right;
}

.panier-sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.panier-total {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    text-align: right;
    color: var(--tg-ink);
}

.panier-checkout-btn {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
}

.panier-checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.panier-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

@media (max-width: 768px) {
    .panier-sidebar {
        width: 100%;
        right: -100%;
    }
}

/* Styles pour l'éditeur de texte enrichi */
.rich-text-editor {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.rich-text-toolbar {
    background: #f5f5f5;
    border-bottom: 1px solid #ddd;
    padding: 8px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.rich-text-toolbar button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.rich-text-toolbar button:hover {
    background: #f0f0f0;
}

.rich-text-toolbar button.active {
    background: #e0e0e0;
    border-color: #999;
}

.rich-text-toolbar select {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background: white;
    cursor: pointer;
}

.rich-text-toolbar input[type="color"] {
    width: 40px;
    height: 32px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
}

.rich-text-editor-content {
    min-height: 150px;
    padding: 12px;
    outline: none;
    background: white;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
}

.rich-text-editor-content:focus {
    outline: none;
}

.rich-text-editor-content p {
    margin: 0 0 8px 0;
}

.rich-text-editor-content p:last-child {
    margin-bottom: 0;
}

/* Styles pour le calendrier de la page d'accueil */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 11px;
}

.calendar-day {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    min-height: 80px;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.calendar-day-empty {
    min-height: 80px;
    background: transparent;
}

@media (max-width: 768px) {
    .calendar-grid {
        font-size: 9px;
        gap: 2px;
    }
    
    .calendar-day {
        padding: 4px;
        min-height: 60px;
    }
}

/* ================================
   Styles pour les différents layouts de menu mensuel
   ================================ */

/* Layout en grille pour 1, 2 ou 3 colonnes */
.meal-grid-one-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meal-grid-two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.meal-grid-three-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Ajustements pour mobile */
@media (max-width: 768px) {
    .meal-grid-two-columns,
    .meal-grid-three-columns {
        grid-template-columns: 1fr;
    }
}

/* Tailles de cartes */
.meal-card-small .meal-card-image-full {
    height: 100px;
}

.meal-card-small .meal-card-name {
    font-size: 0.9rem;
}

.meal-card-small .meal-card-description {
    font-size: 0.75rem;
}

.meal-card-small .btn-select-full {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

.meal-card-medium .meal-card-image-full {
    height: 150px;
}

.meal-card-medium .meal-card-name {
    font-size: 1rem;
}

.meal-card-medium .meal-card-description {
    font-size: 0.85rem;
}

.meal-card-medium .btn-select-full {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.meal-card-large .meal-card-image-full {
    height: 200px;
}

.meal-card-large .meal-card-name {
    font-size: 1.1rem;
}

.meal-card-large .meal-card-description {
    font-size: 0.95rem;
}

.meal-card-large .btn-select-full {
    padding: 0.6rem 1.2rem;
    font-size: 0.95rem;
}

/* Carte sans image - ajustements spéciaux */
.meal-card-full.no-image {
    flex-direction: row;
}

.meal-card-full.no-image .meal-card-content-full {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.meal-card-full.no-image .meal-card-header-full {
    margin-bottom: 0.5rem;
}

.meal-card-full.no-image .meal-card-details-full {
    margin-bottom: 0.75rem;
}

.meal-card-full.no-image .btn-select-full {
    width: auto;
    align-self: flex-start;
}

/* Ajustements pour les cartes sans image en mode 2 colonnes */
@media (min-width: 769px) {
    .meal-grid-two-columns .meal-card-full.no-image {
        flex-direction: column;
    }
    
    .meal-grid-two-columns .meal-card-full.no-image .btn-select-full {
        width: 100%;
    }
}

/* ================================
   Styles pour l'accordéon (style liste simple)
   ================================ */

.meal-card-accordion {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.meal-card-accordion:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.meal-accordion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.meal-accordion-header:hover {
    background-color: #f8f9fa;
}

.meal-accordion-header:active {
    background-color: #e9ecef;
}

.meal-accordion-header .meal-card-name {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.meal-accordion-arrow {
    flex-shrink: 0;
    color: #4F6F52;
    transition: transform 0.3s ease;
    margin-left: 1rem;
}

.meal-accordion-content {
    transition: max-height 0.3s ease-out;
    background-color: #fafafa;
}

.meal-accordion-inner {
    padding: 1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.meal-card-image-accordion {
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
}

.meal-card-image-accordion img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: cover;
    display: block;
}

.meal-card-description-accordion {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #555;
}

.meal-card-variants-accordion {
    font-size: 0.85rem;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    border-left: 3px solid #4F6F52;
}

.meal-card-variants-accordion strong {
    color: #4F6F52;
}

/* Ajustements pour les petites cartes en mode accordéon */
.meal-card-accordion.meal-card-small .meal-accordion-header {
    padding: 0.75rem 1rem;
}

.meal-card-accordion.meal-card-small .meal-card-name {
    font-size: 0.9rem;
}

.meal-card-accordion.meal-card-small .meal-accordion-arrow {
    width: 16px;
    height: 16px;
}

.meal-card-accordion.meal-card-small .meal-accordion-inner {
    padding: 0.75rem 1rem;
}

.meal-card-accordion.meal-card-small .meal-card-image-accordion img {
    max-height: 150px;
}

/* Ajustements pour les grandes cartes en mode accordéon */
.meal-card-accordion.meal-card-large .meal-accordion-header {
    padding: 1.25rem 1.5rem;
}

.meal-card-accordion.meal-card-large .meal-card-name {
    font-size: 1.1rem;
}

.meal-card-accordion.meal-card-large .meal-accordion-arrow {
    width: 24px;
    height: 24px;
}

.meal-card-accordion.meal-card-large .meal-accordion-inner {
    padding: 1.25rem 1.5rem;
}

.meal-card-accordion.meal-card-large .meal-card-image-accordion img {
    max-height: 250px;
}

/* Animation smooth pour mobile */
@media (max-width: 768px) {
    .meal-accordion-header {
        padding: 0.875rem 1rem;
    }
    
    .meal-accordion-inner {
        padding: 0.875rem 1rem;
    }
    
    .meal-card-image-accordion img {
        max-height: 180px;
    }
}

/* ================================
   Layout spécial large pour semaine (2 colonnes)
   ================================ */

.menu-calendar-wide-week {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    width: 100%;
}

.wide-week-row {
    display: grid;
    gap: 1.5rem;
    width: 100%;
}

/* Première ligne : 3 colonnes (Lun, Mar, Mer) */
.wide-week-row-three {
    grid-template-columns: repeat(3, 1fr);
}

/* Deuxième ligne : 2 colonnes (Jeu, Ven) - centrées */
.wide-week-row-two {
    grid-template-columns: repeat(2, 1fr);
    max-width: 66.66%;
    margin: 0 auto;
}

/* Cellules de jour en mode large */
.calendar-day-cell-wide {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.3s ease;
}

.calendar-day-cell-wide:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.calendar-day-cell-wide .day-number-menu {
    font-size: 1.75rem;
    font-weight: 700;
    color: #4F6F52;
    line-height: 1;
}

.calendar-day-cell-wide .day-name-menu {
    font-size: 1rem;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 0.5rem;
}

.calendar-day-cell-wide .day-meals-menu {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Ajustements pour les cartes dans le layout large */
.calendar-day-cell-wide .meal-card-full {
    height: 100%;
}

.calendar-day-cell-wide .meal-grid-two-columns {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    height: 100%;
}

/* Cartes de repas en 2 colonnes - plus compactes */
.calendar-day-cell-wide .meal-grid-two-columns .meal-card-full {
    display: flex;
    flex-direction: column;
}

/* Images réduites dans le layout large pour optimiser l'espace */
.calendar-day-cell-wide .meal-card-image-full {
    height: 120px;
}

.calendar-day-cell-wide .meal-card-large .meal-card-image-full {
    height: 140px;
}

.calendar-day-cell-wide .meal-card-small .meal-card-image-full {
    height: 100px;
}

/* Ajustement du texte pour les cartes en 2 colonnes dans layout large */
.calendar-day-cell-wide .meal-grid-two-columns .meal-card-name {
    font-size: 0.95rem;
}

.calendar-day-cell-wide .meal-grid-two-columns .meal-card-description {
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Responsive pour le layout large */
@media (max-width: 1400px) {
    .calendar-day-cell-wide .meal-card-image-full {
        height: 110px;
    }
}

@media (max-width: 1200px) {
    .wide-week-row-three {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .wide-week-row-two {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    
    .calendar-day-cell-wide .meal-card-image-full {
        height: 100px;
    }
}

@media (max-width: 900px) {
    /* Passer en 1 colonne de repas par jour sur tablette */
    .calendar-day-cell-wide .meal-grid-two-columns {
        grid-template-columns: 1fr;
    }
    
    .calendar-day-cell-wide .meal-card-image-full {
        height: 140px;
    }
}

@media (max-width: 768px) {
    .wide-week-row-three,
    .wide-week-row-two {
        grid-template-columns: 1fr;
        max-width: 100%;
    }
    
    .menu-calendar-wide-week {
        gap: 1rem;
    }
    
    .wide-week-row {
        gap: 1rem;
    }
    
    .calendar-day-cell-wide {
        padding: 1rem;
    }
    
    .calendar-day-cell-wide .day-number-menu {
        font-size: 1.5rem;
    }
    
    .calendar-day-cell-wide .meal-card-image-full {
        height: 150px;
    }
    
    .calendar-day-cell-wide .meal-grid-two-columns {
        grid-template-columns: 1fr;
    }
}

