/* Styles personnalisés pour LTD Little Seoul */

:root {
    --primary: #5E5CE6;
    --secondary: #2a2a2a;
    --background: #0f0f0f;
    --surface: #1a1a1a;
    --surface-light: #2a2a2a;
    --text: #ffffff;
    --text-secondary: #b0b0b0;
    --border: #3b3a3a;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--background);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0;
    padding: 1rem 2rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    position: relative;
}

.header-links {
    position: absolute;
    top: 10px;
    right: 10px;
}

header h1 {
    font-size: 2.5rem;
    margin: 0 0 0.5rem 0;
    color: var(--text);
}

header h1 .gradient-text {
    background: linear-gradient(135deg, var(--primary), #8b87ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1.1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--surface);
    padding: 0.5rem;
    border-radius: 12px;
    overflow-x: auto;
}

.tab-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1.5rem;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.tab-btn:hover {
    background: var(--surface-light);
    color: var(--text);
}

.tab-btn.active {
    background: var(--primary);
    color: white;
}

/* Liens externes */
.external-links {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.external-link {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary), #4CAF50);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.external-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    text-decoration: none;
    color: white;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

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

/* Cards */
.card {
    background: var(--surface);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border);
}

.card h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.75rem;
    color: var(--text);
}

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

.card-header h2 {
    margin: 0;
}

.card-header .filter-options {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.card-header .filter-options select {
    padding: 0.5rem 1rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 180px;
}

.card-header .filter-options select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 92, 230, 0.1);
}

.card-header .filter-options label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
}

/* Filters Bar */
.filters-bar {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.filters-bar .form-group {
    margin-bottom: 0;
}

.filters-bar input,
.filters-bar select {
    width: 100%;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 92, 230, 0.1);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: #4a48d6;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(94, 92, 230, 0.4);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text);
    text-decoration: none !important;
}

.btn-secondary:hover {
    background: #3a3a3a;
    text-decoration: none !important;
}

/* Liens avec classes de boutons */
a.btn {
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

a.btn:hover {
    text-decoration: none !important;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

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

/* Results */
.results {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--background);
    border-radius: 12px;
    border: 2px solid var(--primary);
}

.results h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary);
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    background: var(--surface);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.result-item.highlight {
    background: linear-gradient(135deg, rgba(94, 92, 230, 0.2), rgba(139, 135, 255, 0.2));
    border: 1px solid var(--primary);
}

.result-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-value {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--text);
}

.result-item.highlight .result-value {
    color: var(--primary);
}

#recipe-details {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

#recipe-details h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

#recipe-ingredients {
    list-style: none;
    padding: 0;
    margin: 0;
}

#recipe-ingredients li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

#recipe-ingredients li:last-child {
    border-bottom: none;
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--background);
}

th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

td {
    padding: 1rem;
    border-top: 1px solid var(--border);
}

tr:hover {
    background: var(--background);
}

td .btn {
    margin-right: 0.5rem;
}

/* Recipes Grid */
.recipes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.recipe-card {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.recipe-card:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.recipe-card.recipe-inactive {
    opacity: 0.6;
    border-color: var(--danger);
}

.recipe-card.recipe-inactive:hover {
    opacity: 0.8;
    border-color: var(--danger);
}

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

.recipe-card h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text);
    font-size: 1.1rem;
    flex: 1;
}

.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.status-active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.status-inactive {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.status-sale {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid #3b82f6;
}

.status-no-sale {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
    border: 1px solid #9ca3af;
}

.recipe-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.75rem;
}

.recipe-ingredients {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.recipe-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* Product images in table */
.product-name-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.product-mini-img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border);
}

/* Supplier images in table */
.supplier-image-cell {
    text-align: center;
    width: 60px;
}

.supplier-image {
    width: 45px;
    height: 45px;
    object-fit: cover;
    background-color: var(--surface);
    transition: all 0.2s ease;
}

.supplier-image:hover {
    transform: scale(1.05);
}

.supplier-icon {
    font-size: 24px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--surface-light);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--surface);
    padding: 2rem;
    border-radius: 16px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border);
    animation: slideUp 0.3s ease;
}

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

.modal-close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--danger);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--text);
}

/* Ingredient Rows */
.ingredient-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.ingredient-row select,
.ingredient-row input {
    flex: 1;
}

.ingredient-row .ingredient-product {
    flex: 2;
}

.ingredient-row .ingredient-quantity {
    flex: 1;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background);
}

::-webkit-scrollbar-thumb {
    background: var(--surface-light);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .filters-bar {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .recipes-grid {
        grid-template-columns: 1fr;
    }
    
    .card-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .ingredient-row {
        flex-direction: column;
    }
}

/* Loading State */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(94, 92, 230, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary);
    animation: spin 0.8s linear infinite;
}

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Pricing Table Styles */
.pricing-table-container {
    overflow-x: auto;
    margin-top: 1rem;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.pricing-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    table-layout: auto;
}

.pricing-table thead {
    background: rgba(94, 92, 230, 0.1);
    position: sticky;
    top: 0;
    z-index: 10;
}

.pricing-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid var(--border);
    white-space: nowrap;
}

.pricing-table th:nth-child(1) { width: 60px; }  /* Image */
.pricing-table th:nth-child(2) { width: 100px; } /* Catégorie */
.pricing-table th:nth-child(3) { width: auto; }  /* Recette */
.pricing-table th:nth-child(4) { width: 110px; } /* Coût */
.pricing-table th:nth-child(5) { width: 110px; } /* Prix estimé */
.pricing-table th:nth-child(6) { width: 120px; } /* Prix de vente */
.pricing-table th:nth-child(7) { width: 100px; } /* Marge $ */
.pricing-table th:nth-child(8) { width: 100px; } /* Marge % */
.pricing-table th:nth-child(9) { width: auto; }  /* Ingrédients */

.pricing-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s ease;
}

.pricing-table tbody tr:hover {
    background: rgba(94, 92, 230, 0.05);
}

.pricing-table tbody tr.inactive {
    opacity: 0.5;
}

.pricing-table td {
    padding: 0.75rem;
    vertical-align: middle;
}

.pricing-table .recipe-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    background: var(--background);
}

.pricing-table .recipe-name {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricing-table .cost-price,
.pricing-table .suggested-price {
    font-weight: 600;
    color: var(--text-secondary);
}

.pricing-table .sell-price-input {
    width: 100px;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
}

.pricing-table .sell-price-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(94, 92, 230, 0.1);
}

.pricing-table .margin-display {
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    display: inline-block;
    min-width: 70px;
    text-align: center;
    font-size: 0.9rem;
}

/* Code couleur selon les marges */
.pricing-table .margin-display.margin-negative,
.pricing-table .margin-display.margin-very-low {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.pricing-table .margin-display.margin-low {
    background: rgba(249, 115, 22, 0.15);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.3);
}

.pricing-table .margin-display.margin-medium {
    background: rgba(234, 179, 8, 0.15);
    color: #eab308;
    border: 1px solid rgba(234, 179, 8, 0.3);
}

.pricing-table .margin-display.margin-good {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.pricing-table .margin-display.margin-excellent {
    background: rgba(234, 179, 8, 0.25);
    color: #d97706;
    border: 1px solid rgba(217, 119, 6, 0.4);
    font-weight: 800;
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

.pricing-table .ingredients-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    max-width: 100%;
}

.pricing-table .ingredient-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--background);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.pricing-table .ingredient-image {
    width: 24px;
    height: 24px;
    object-fit: cover;
    border-radius: 3px;
}

.pricing-table .ingredient-quantity {
    color: var(--primary);
    font-weight: 600;
}

/* Category Badge */
.category-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    text-align: center;
    white-space: nowrap;
}

/* History Styles */
#history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-entry {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
}

.history-entry:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(94, 92, 230, 0.1);
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.history-date {
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.history-count {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.history-changes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.change-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 6px;
    background: var(--background);
    border-left: 3px solid transparent;
}

.change-item.change-add {
    border-left-color: #22c55e;
    background: rgba(34, 197, 94, 0.05);
}

.change-item.change-edit {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.change-item.change-delete {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.change-icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.change-type {
    background: var(--surface-light);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--text-secondary);
}

.change-action {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: capitalize;
}

.change-add .change-action {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.change-edit .change-action {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.change-delete .change-action {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.change-name {
    font-weight: 600;
    color: var(--text);
    flex: 1;
}

.change-details {
    flex: 1;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: 4px;
    border: 1px solid var(--border);
}

.diff-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.diff-item strong {
    color: var(--text-secondary);
    min-width: 120px;
}

.diff-item .before {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
}

.diff-item .after {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
}

.diff-item .arrow {
    color: var(--text-secondary);
    font-weight: bold;
}

/* ===== CALCULETTE CLIENT ===== */
.calculator-summary {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.summary-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.summary-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
    padding: 20px;
    min-height: 400px;
}

.calculator-item {
    background: #1a1a1a;
    border: 2px solid #444;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    height: 130px;
}

.calculator-item:hover {
    border-color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.calculator-item.in-cart {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.15);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.2);
}

.calculator-item img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 80%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 4px;
}

.calculator-item .item-name {
    display: none;
}

.calculator-item .item-price {
    display: none;
}

.calculator-item-quantity {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
}

/* Toast notifications CSS */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: auto;
    position: relative;
    min-width: 300px;
    max-width: 400px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.toast-slide-in {
    opacity: 1;
    transform: translateX(0);
}

.toast-slide-out {
    opacity: 0;
    transform: translateX(100%);
}

.toast-icon {
    font-size: 20px;
    line-height: 1;
    margin-top: 2px;
    flex-shrink: 0;
}

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

.toast-message {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
    word-wrap: break-word;
}

.toast-close {
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: inherit;
    opacity: 0.7;
    transition: opacity 0.2s;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toast-close:hover {
    opacity: 1;
}

.toast-success {
    background: rgba(16, 185, 129, 0.95);
    color: white;
    border-left: 4px solid #059669;
}

.toast-error {
    background: rgba(239, 68, 68, 0.95);
    color: white;
    border-left: 4px solid #DC2626;
}

.toast-warning {
    background: rgba(245, 158, 11, 0.95);
    color: white;
    border-left: 4px solid #D97706;
}

.toast-info {
    background: rgba(59, 130, 246, 0.95);
    color: white;
    border-left: 4px solid #2563EB;
}

@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        margin: 0 0 10px 0;
    }
}

.toast:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

.import-notification {
    display: none !important;
}

/* Multi-select filter actions */
.multi-select-actions {
    border-top: 1px solid #ddd;
    padding: 8px;
    background-color: #f9f9f9;
}

.multi-select-actions .btn-link {
    background: none;
    border: none;
    color: #007bff;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 4px;
    margin-right: 8px;
}

.multi-select-actions .btn-link:hover {
    color: #0056b3;
}

.multi-select-actions .btn {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 3px;
    border: 1px solid #007bff;
    cursor: pointer;
    transition: all 0.2s;
}

.multi-select-actions .btn-primary {
    background-color: #007bff;
    color: white;
}

.multi-select-actions .btn-primary:hover {
    background-color: #0056b3;
}

.multi-select-actions .btn-sm {
    font-size: 11px;
    padding: 3px 8px;
}

/* =============== STOCKAGE STYLES =============== */

#stockage .card {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
}

.stockage-info {
    margin-top: 10px;
    padding: 12px;
    background: var(--surface);
    border-radius: 6px;
    border-left: 4px solid var(--primary);
}

.stockage-info p {
    margin: 0 0 10px 0;
    color: var(--text-secondary);
}

.stockage-container {
    display: flex;
    flex: 1;
    gap: 20px;
    margin-top: 20px;
    height: 500px;
    overflow: hidden;
}

.stockage-sidebar {
    width: 300px;
    background: var(--surface);
    border-radius: 8px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px 20px 0 20px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.sidebar-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.stockage-sidebar h3 {
    margin: 0 0 15px 0;
    color: var(--text);
    font-size: 16px;
}

.filter-container {
    margin-bottom: 15px;
}

.filter-container select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--background);
    color: var(--text);
}

.available-recipes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.recipe-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: grab;
    transition: all 0.2s ease;
    color: var(--text);
    font-size: 14px;
}

.recipe-item:hover {
    background: var(--surface-light);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.recipe-item:active {
    cursor: grabbing;
    transform: scale(0.95);
}

.recipe-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.stockage-main {
    flex: 1;
    background: var(--surface);
    border-radius: 8px;
    padding: 20px;
    height: 100%;
    overflow: hidden;
}

.stockage-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    background: var(--border);
    border-radius: 6px;
    padding: 2px;
    min-width: 500px;
    height: 500px;
    overflow-y: auto;
}

.grid-header {
    background: var(--surface-light);
    padding: 12px;
    text-align: center;
    font-weight: bold;
    color: var(--text);
    border-radius: 4px;
}

.grid-row-label {
    background: var(--surface-light);
    padding: 12px;
    text-align: center;
    font-weight: bold;
    color: var(--text);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-cell {
    background: var(--background);
    border-radius: 4px;
    min-height: 80px;
    position: relative;
    transition: all 0.2s ease;
    cursor: pointer;
    border: 2px dashed transparent;
}

.grid-cell:hover {
    border-color: var(--primary);
}

.grid-cell.drag-over {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.grid-cell.occupied:not(.category-nourriture):not(.category-boisson):not(.category-civil):not(.category-crimi):not(.category-undefined) {
    background: var(--primary);
    border: 2px solid var(--primary);
}

.grid-cell.occupied:not(.category-nourriture):not(.category-boisson):not(.category-civil):not(.category-crimi):not(.category-undefined):hover {
    background: var(--secondary);
}

.cell-content {
    padding: 4px;
    height: 100%;
    display: flex;
    flex-direction: row;
    align-items: center;
    position: relative;
}

.cell-left {
    width: 30%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.cell-right {
    width: 70%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding-left: 4px;
}

.cell-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.cell-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 4px;
    aspect-ratio: 1;
}

.cell-recipe-name {
    font-size: 11px;
    font-weight: bold;
    color: white;
    margin-bottom: 4px;
    line-height: 1.2;
}

.cell-stock-info {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.1;
}

.stock-line {
    margin-bottom: 1px;
}

/* Modal Stockage */
.recipe-display, .position-display {
    background: var(--surface);
    padding: 10px;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: bold;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* Responsive */
@media (max-width: 1200px) {
    .stockage-container {
        flex-direction: column;
    }
    
    .stockage-sidebar {
        width: 100%;
        max-height: 200px;
    }
    
    .stockage-main {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .stockage-grid {
        grid-template-columns: repeat(5, 1fr);
        min-width: 100%;
    }
    
    .grid-cell {
        min-height: 60px;
    }
    
    .cell-recipe-name {
        font-size: 11px;
    }
    
    .cell-stock-info {
        font-size: 9px;
    }
}


