body {
    background: linear-gradient(180deg, #FEFDFB 0%, #FFF8F3 100%);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}
/* =========================
   Index
   ========================= */
.ingredients-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-header {
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.header-title h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #2C2C2C;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.header-subtitle {
    color: #6B6B6B;
    font-size: 1.1rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-add-ingredient {
    background: #2C2C2C;
    color: white;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
}

.btn-add-ingredient:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 44, 44, 0.2);
    color: white;
}

.search-bar {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid #F0F0F0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.search-input {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #2C2C2C;
    box-shadow: 0 0 0 4px rgba(44, 44, 44, 0.1);
}

.stats-bar {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    border: 1px solid #F0F0F0;
    flex: 1;
    min-width: 200px;
    animation: fadeInUp 0.6s ease-out both;
}

.stat-card:nth-child(1) { animation-delay: 0.15s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.25s; }

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #2C2C2C;
    display: block;
}

.stat-label {
    color: #6B6B6B;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* GRID LAYOUT POUR LES INGRÉDIENTS */
.ingredients-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.ingredient-card {
    background: white;
    border-radius: 16px;
    border: 2px solid #F0F0F0;
    padding: 1.5rem;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ingredient-card:hover {
    border-color: #E0E0E0;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.ingredient-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.ingredient-name {
    font-weight: 700;
    color: #2C2C2C;
    font-size: 1.2rem;
    flex: 1;
}

.ingredient-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.category-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.category-legumes { 
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #2E7D32;
}

.category-viandes { 
    background: linear-gradient(135deg, #EFEBE9 0%, #D7CCC8 100%);
    color: #5D4037;
}

.category-poissons { 
    background: linear-gradient(135deg, #E1F5FE 0%, #B3E5FC 100%);
    color: #0277BD;
}

.category-produits-laitiers { 
    background: linear-gradient(135deg, #FFF9C4 0%, #FFF59D 100%);
    color: #F57F17;
}

.category-epices { 
    background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
    color: #C2185B;
}

.category-cereales { 
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    color: #F57C00;
}

.category-fruits { 
    background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
    color: #7B1FA2;
}

.category-default { 
    background: linear-gradient(135deg, #F5F5F5 0%, #E0E0E0 100%);
    color: #616161;
}

.ingredient-actions {
    display: flex;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #F0F0F0;
}

.btn-action {
    flex: 1;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 2px solid transparent;
}

.btn-view {
    background: white;
    color: #4A90E2;
    border-color: #E8F3FF;
}

.btn-view:hover {
    background: #E8F3FF;
    border-color: #4A90E2;
    transform: translateY(-2px);
}

.btn-edit {
    background: white;
    color: #2C2C2C;
    border-color: #E8E8E8;
}

.btn-edit:hover {
    background: #2C2C2C;
    color: white;
    transform: translateY(-2px);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 20px;
    border: 2px dashed #E0E0E0;
}

.empty-state-icon {
    font-size: 4rem;
    color: #D0D0D0;
    margin-bottom: 1.5rem;
}

.empty-state h3 {
    color: #2C2C2C;
    font-weight: 700;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #6B6B6B;
    margin-bottom: 2rem;
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 16px;
    border: 2px dashed #E0E0E0;
}

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

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

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .header-title h1 {
        font-size: 2rem;
    }

    .btn-add-ingredient {
        width: 100%;
        justify-content: center;
    }

    .ingredients-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        flex-direction: column;
    }

    .stat-card {
        min-width: 100%;
    }
}

/* =========================
   New
   ========================= */

.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-header {
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.back-button {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #E8E8E8;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2C2C2C;
    transition: all 0.3s ease;
    text-decoration: none;
}

.back-button:hover {
    background: #2C2C2C;
    color: white;
    border-color: #2C2C2C;
    transform: translateX(-4px);
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2C2C2C;
    margin: 0;
    letter-spacing: -1px;
}

.header-subtitle {
    color: #6B6B6B;
    font-size: 1.1rem;
    margin-left: 56px;
}

.form-card {
    background: white;
    border-radius: 20px;
    border: 1px solid #F0F0F0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.form-header {
    background: linear-gradient(135deg, #FFF8F3 0%, #FFE8D6 100%);
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #FFE8D6;
}

.form-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2C2C2C;
}

.form-body {
    padding: 2.5rem;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #2C2C2C;
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.form-group label.required::after {
    content: ' *';
    color: #E74C3C;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1.25rem;
    border: 2px solid #E8E8E8;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #FEFDFB;
}

.form-control:focus {
    outline: none;
    border-color: #2C2C2C;
    box-shadow: 0 0 0 4px rgba(44, 44, 44, 0.1);
    background: white;
}

.form-control:hover {
    border-color: #D0D0D0;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232C2C2C' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    padding-right: 3rem;
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.form-help {
    font-size: 0.875rem;
    color: #6B6B6B;
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    padding-top: 2rem;
    border-top: 2px solid #F5F5F5;
    margin-top: 2rem;
}

.btn {
    padding: 0.85rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
    cursor: pointer;
}

.btn-cancel {
    background: white;
    color: #2C2C2C;
    border-color: #E8E8E8;
}

.btn-cancel:hover {
    background: #F5F5F5;
    border-color: #D0D0D0;
    transform: translateY(-2px);
}

.btn-submit {
    background: #2C2C2C;
    color: white;
    border-color: #2C2C2C;
}

.btn-submit:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 44, 44, 0.2);
}

.form-error {
    color: #E74C3C;
    font-size: 0.875rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-error::before {
    content: '⚠';
}

.invalid-feedback {
    display: block;
    color: #E74C3C;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-control.is-invalid {
    border-color: #E74C3C;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.1);
}

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

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

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }

    .form-body {
        padding: 1.5rem;
    }

    .form-actions {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* =========================
   Show
   ========================= */



   body {
    background: linear-gradient(180deg, #FEFDFB 0%, #FFF8F3 100%);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.detail-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.page-header {
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.back-button {
    width: 40px;
    height: 40px;
    background: white;
    border: 2px solid #E8E8E8;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2C2C2C;
    transition: all 0.3s ease;
    text-decoration: none;
    flex-shrink: 0;
}

.back-button:hover {
    background: #2C2C2C;
    color: white;
    border-color: #2C2C2C;
    transform: translateX(-4px);
}

.header-title {
    flex: 1;
}

.header-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2C2C2C;
    margin: 0 0 0.5rem 0;
    letter-spacing: -1px;
    word-break: break-word;
}

.header-subtitle {
    color: #6B6B6B;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.btn {
    padding: 0.85rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}

.btn-primary {
    background: #2C2C2C;
    color: white;
    border-color: #2C2C2C;
}

.btn-primary:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 44, 44, 0.2);
}

.btn-secondary {
    background: white;
    color: #2C2C2C;
    border-color: #E8E8E8;
}

.btn-secondary:hover {
    background: #F5F5F5;
    border-color: #D0D0D0;
    transform: translateY(-2px);
}

.detail-card {
    background: white;
    border-radius: 20px;
    border: 1px solid #F0F0F0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out 0.2s both;
    margin-bottom: 2rem;
}

.card-header {
    background: linear-gradient(135deg, #FFF8F3 0%, #FFE8D6 100%);
    padding: 1.5rem 2rem;
    border-bottom: 2px solid #FFE8D6;
}

.card-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2C2C2C;
}

.card-body {
    padding: 2.5rem;
}

.info-grid {
    display: grid;
    gap: 2rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.info-label {
    font-weight: 700;
    color: #6B6B6B;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-value {
    font-size: 1.25rem;
    color: #2C2C2C;
    font-weight: 600;
    padding: 1rem;
    background: linear-gradient(135deg, #FEFDFB 0%, #FFF8F3 100%);
    border-radius: 12px;
    border: 1px solid #F0F0F0;
}

.info-id {
    font-family: 'Courier New', monospace;
    color: #6B6B6B;
    font-size: 1rem;
}

.category-badge {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
}

.category-legumes { 
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    color: #2E7D32;
}

.category-viandes { 
    background: linear-gradient(135deg, #EFEBE9 0%, #D7CCC8 100%);
    color: #5D4037;
}

.category-poissons { 
    background: linear-gradient(135deg, #E1F5FE 0%, #B3E5FC 100%);
    color: #0277BD;
}

.category-produits-laitiers { 
    background: linear-gradient(135deg, #FFF9C4 0%, #FFF59D 100%);
    color: #F57F17;
}

.category-epices { 
    background: linear-gradient(135deg, #FCE4EC 0%, #F8BBD0 100%);
    color: #C2185B;
}

.category-cereales { 
    background: linear-gradient(135deg, #FFF8E1 0%, #FFECB3 100%);
    color: #F57C00;
}

.category-fruits { 
    background: linear-gradient(135deg, #F3E5F5 0%, #E1BEE7 100%);
    color: #7B1FA2;
}

.category-default { 
    background: linear-gradient(135deg, #F5F5F5 0%, #E0E0E0 100%);
    color: #616161;
}

.danger-zone {
    background: white;
    border-radius: 20px;
    border: 2px solid #FFEBEE;
    box-shadow: 0 4px 20px rgba(231, 76, 60, 0.08);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.danger-zone-header {
    background: linear-gradient(135deg, #FFEBEE 0%, #FFCDD2 100%);
    padding: 1.25rem 2rem;
    border-bottom: 2px solid #FFCDD2;
}

.danger-zone-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: #C62828;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.danger-zone-body {
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.danger-zone-text {
    flex: 1;
    min-width: 250px;
}

.danger-zone-text p {
    margin: 0 0 0.5rem 0;
    color: #2C2C2C;
    font-weight: 600;
}

.danger-zone-text small {
    color: #6B6B6B;
}

.btn-danger {
    background: white;
    color: #E74C3C;
    border: 2px solid #E74C3C;
}

.btn-danger:hover {
    background: #E74C3C;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(231, 76, 60, 0.3);
}

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

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

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }

    .header-left {
        order: 1;
    }

    .header-actions {
        order: 2;
        width: 100%;
    }

    .btn {
        flex: 1;
        justify-content: center;
    }

    .header-title h1 {
        font-size: 2rem;
    }

    .card-body {
        padding: 1.5rem;
    }

    .danger-zone-body {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-danger {
        width: 100%;
        justify-content: center;
    }
}