/* ===== VARIABLES ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 8px;
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: #f1f5f9;
    color: var(--dark-color);
    line-height: 1.5;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== LOADING OVERLAY ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    text-align: center;
}

.loading-spinner i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.loading-spinner p {
    color: var(--secondary-color);
    font-weight: 500;
}

/* ===== HEADER ===== */
.header {
    background: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    border-bottom: 1px solid var(--border-color);
}

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

.header-left h1 {
    font-size: 1.5rem;
    color: var(--dark-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header-left h1 i {
    color: var(--primary-color);
}

.user-role-badge {
    background: var(--light-color);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    border: 1px solid var(--border-color);
}

.user-role-badge.admin {
    background: #dbeafe;
    color: var(--primary-dark);
    border-color: #bfdbfe;
}

.user-role-badge.user {
    background: #f1f5f9;
    color: #64748b;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.user-info i {
    color: var(--primary-color);
}

.btn-logout {
    background: var(--light-color);
    color: var(--danger-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background: #fee2e2;
    border-color: #fecaca;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-subtitle {
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

/* ===== ACTIONS SECTION ===== */
.actions-section {
    margin-bottom: 3rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 1rem;
}

.action-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    min-height: 220px; /* Hauteur uniforme */
}

.action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Pour les écrans moyens (tablettes) */
@media (max-width: 1024px) {
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Pour les écrans mobiles */
@media (max-width: 768px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }

    .action-card {
        min-height: auto; /* Hauteur auto sur mobile */
    }
}

.action-icon.blue {
    background: #dbeafe;
    color: #2563eb;
}

.action-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.action-icon.red {
    background: #fee2e2;
    color: #dc2626;
}

.action-icon.green {
    background: #d1fae5;
    color: #059669;
}

.action-icon.orange {
    background: #fed7aa;
    color: #ea580c;
}

.action-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.action-card p {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.action-options {
    display: flex;
    gap: 0.75rem;
}

.option-btn {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    background: var(--light-color);
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

/* ===== SEARCH SECTION ===== */
.search-section {
    margin-bottom: 3rem;
}

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

.search-box {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

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

.search-header i {
    font-size: 1.25rem;
    color: var(--primary-color);
}

.search-header h3 {
    font-size: 1.125rem;
    color: var(--dark-color);
}

.search-input-group {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.875rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.search-btn:hover {
    background: var(--primary-dark);
}

/* ===== ADMIN SECTION ===== */
.admin-section {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: none; /* Caché par défaut */
}

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

.admin-header h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--dark-color);
}

.admin-badges {
    display: flex;
    gap: 0.75rem;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.admin-badge {
    background: #dbeafe;
    color: var(--primary-dark);
}

.permissions-badge {
    background: #f1f5f9;
    color: var(--secondary-color);
}

/* Alertes admin */
.admin-alerts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.alert-card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.alert-header {
    background: var(--light-color);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.alert-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-small {
    padding: 0.25rem 0.75rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.btn-small:hover {
    background: var(--light-color);
}

.alert-content {
    padding: 1.5rem;
}

.alert-loading {
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
}

.alert-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.alert-table th {
    text-align: left;
    padding: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--secondary-color);
    font-weight: 500;
}

.alert-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.alert-table tr:last-child td {
    border-bottom: none;
}

.alert-empty {
    text-align: center;
    padding: 2rem;
    color: var(--success-color);
}

.alert-empty i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Boutons admin */
.admin-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.admin-btn {
    padding: 1rem;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.admin-btn:hover {
    background: var(--light-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.admin-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

.admin-btn span {
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
}

/* ===== STATS SECTION ===== */
.stats-section {
    margin-bottom: 3rem;
}

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

.stat-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.blue {
    background: #dbeafe;
    color: var(--primary-color);
}

.stat-icon.green {
    background: #d1fae5;
    color: var(--success-color);
}

.stat-icon.orange {
    background: #fed7aa;
    color: var(--warning-color);
}

.stat-icon.purple {
    background: #e9d5ff;
    color: #8b5cf6;
}

.stat-info h3 {
    font-size: 0.875rem;
    color: var(--secondary-color);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-color);
}

/* ===== FOOTER ===== */
.footer {
    background: white;
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.footer-info {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

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

    .main-content {
        padding: 1rem;
    }

    .actions-grid,
    .search-container,
    .admin-alerts,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .search-input-group {
        flex-direction: column;
    }

    .admin-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Styles pour les popups */
.search-popup-overlay,
.details-popup-overlay,
.edit-popup-overlay,
.print-popup-overlay,
.history-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.search-popup,
.details-popup,
.edit-popup,
.print-popup,
.history-popup {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: popupFadeIn 0.3s ease;
}

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

.popup-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.4rem;
}

.close-popup {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.close-popup:hover {
    background-color: #f5f5f5;
    color: #333;
}

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

.popup-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Résultats de recherche */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-item {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #eee;
    transition: all 0.2s;
}

.result-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.result-main h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 1.1rem;
}

.result-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
    color: #666;
}

.result-details span {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
}

/* Boutons d'action dans les résultats de recherche */
.result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.btn-action {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 100px;
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.5);
    color: white;
}

.btn-action:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(108, 117, 125, 0.3);
}

/* Couleurs spécifiques pour chaque bouton */
.btn-action.view-details {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.btn-action.view-details:hover {
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.5);
}

.btn-action.quick-edit {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
}

.btn-action.quick-edit:hover {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.5);
}

.btn-action.print-label {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 2px 6px rgba(243, 156, 18, 0.3);
}

.btn-action.print-label:hover {
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.5);
}

.btn-action.show-location {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    box-shadow: 0 2px 6px rgba(46, 204, 113, 0.3);
}

.btn-action.show-location:hover {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.5);
}

/* Taille réduite pour les boutons */
.btn-small {
    padding: 6px 12px;
    font-size: 11px;
    min-width: 80px;
    gap: 4px;
}

.btn-small i {
    font-size: 12px;
}

/* Détails article */
.article-details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.detail-item {
    display: flex;
    flex-direction: column;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.detail-item span,
.detail-item p {
    color: #333;
}

.detail-item p {
    margin: 0;
    background: #f9f9f9;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.95rem;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Formulaire édition */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 0.95rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Aperçu impression */
.print-preview {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.label-preview {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    min-width: 200px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.label-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 8px;
    color: #333;
}

.label-details {
    font-size: 12px;
    color: #666;
    margin-bottom: 15px;
}

.label-barcode {
    font-family: monospace;
    font-size: 11px;
    letter-spacing: 2px;
    background: #f5f5f5;
    padding: 8px;
    border-radius: 4px;
}

.print-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.checkbox-group {
    grid-column: 1 / -1;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.print-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

/* Historique */
.history-table {
    overflow-x: auto;
}

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

.history-table th {
    background: #f8f9fa;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid #dee2e6;
}

.history-table td {
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.history-table tr:hover td {
    background: #f8f9fa;
}

.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.text-success {
    color: #28a745;
    font-weight: 600;
}

.text-danger {
    color: #dc3545;
    font-weight: 600;
}

.empty-history {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.empty-history i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 15px;
}

.empty-history p {
    margin: 0;
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .search-popup,
    .details-popup,
    .edit-popup,
    .print-popup,
    .history-popup {
        width: 95%;
        max-height: 85vh;
    }

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

    .print-options {
        grid-template-columns: 1fr;
    }

    .article-details-grid {
        grid-template-columns: 1fr;
    }

    .result-actions {
        flex-direction: column;
        gap: 6px;
    }

    .btn-action {
        width: 100%;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }
}

/* ===== STYLES POUR LES POPUPS DE STOCK ===== */
.stock-popup-overlay,
.scan-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
    animation: overlayFadeIn 0.3s ease;
}

@keyframes overlayFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.stock-popup,
.scan-popup {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: popupSlideIn 0.3s ease;
}

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

.popup-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px 12px 0 0;
}

.popup-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.popup-header h3 i {
    color: var(--primary-color);
}

.popup-content {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}

.popup-section {
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.popup-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.popup-section h4 {
    margin: 0 0 16px 0;
    color: #495057;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.popup-section h4 i {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Formulaires dans les popups */
.search-combo {
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-btn-sm,
.scan-btn-sm {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

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

.scan-btn-sm {
    background: var(--info-color);
    color: white;
}

.search-btn-sm:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

.scan-btn-sm:hover {
    background: #17a2b8;
    transform: translateY(-1px);
}

/* Articles sélectionnés */
.selected-article {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 16px;
    margin-top: 15px;
    border-left: 4px solid var(--primary-color);
}

.article-summary strong {
    display: block;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 8px;
}

.article-details {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.9rem;
    color: #6c757d;
}

.article-details span {
    background: white;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #dee2e6;
}

/* Résultats de recherche dans popup */
.search-results {
    margin-top: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.results-list {
    max-height: 200px;
    overflow-y: auto;
}

.result-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
}

.result-item:hover {
    background-color: #f8f9fa;
}

.result-info h5 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 1rem;
}

.btn-select-article {
    padding: 6px 12px;
    background: var(--success-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.btn-select-article:hover {
    background: #28a745;
    transform: translateY(-1px);
}

.no-results {
    padding: 30px 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

/* Grille de formulaire */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group small {
    display: block;
    margin-top: 6px;
    font-size: 0.85rem;
    color: #6c757d;
}

/* Badge utilisateur */
.user-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: #e9ecef;
    border-radius: 8px;
    color: #495057;
}

.user-badge i {
    color: var(--primary-color);
}

.user-badge small {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 2px;
}

/* Footer du popup */
.popup-footer {
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
}

/* Styles spécifiques au popup de scan */
.scan-section {
    text-align: center;
    margin-bottom: 25px;
}

.camera-placeholder {
    background: #f8f9fa;
    border: 3px dashed #dee2e6;
    border-radius: 12px;
    padding: 40px 20px;
    margin-bottom: 20px;
}

.camera-placeholder i {
    font-size: 64px;
    color: #adb5bd;
    margin-bottom: 15px;
}

.camera-placeholder p {
    color: #6c757d;
    font-size: 1.1rem;
}

#cameraPreview {
    width: 100%;
    max-height: 400px;
    border-radius: 12px;
    background: #000;
    margin-bottom: 20px;
}

.scan-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.manual-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.scan-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 1.1rem;
    font-family: monospace;
    text-align: center;
}

.scan-instructions {
    background: #e8f4fc;
    border-radius: 10px;
    padding: 16px;
    border-left: 4px solid var(--info-color);
}

.instruction {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.instruction:last-child {
    margin-bottom: 0;
}

.instruction i {
    color: var(--info-color);
    margin-top: 3px;
}

.instruction p {
    margin: 0;
    font-size: 0.95rem;
    color: #495057;
}

.scan-stats {
    font-size: 0.95rem;
    color: #495057;
}

#scanStatus {
    padding: 8px 16px;
    background: #f8f9fa;
    border-radius: 20px;
    border: 1px solid #dee2e6;
}

/* Responsive */
@media (max-width: 768px) {
    .stock-popup,
    .scan-popup {
        width: 95%;
        max-height: 85vh;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .search-combo {
        flex-direction: column;
        align-items: stretch;
    }

    .search-btn-sm,
    .scan-btn-sm {
        width: 100%;
        justify-content: center;
    }

    .popup-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .popup-footer .btn {
        width: 100%;
    }

    .article-details {
        flex-direction: column;
        gap: 8px;
    }

    .scan-controls {
        flex-direction: column;
    }

    .scan-controls .btn {
        width: 100%;
    }
}

/* Animations de confirmation */
@keyframes pulseSuccess {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

.success-confirm {
    animation: pulseSuccess 1.5s infinite;
}

@keyframes pulseWarning {
    0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 193, 7, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

.warning-confirm {
    animation: pulseWarning 1.5s infinite;
}

@keyframes pulseDanger {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.danger-confirm {
    animation: pulseDanger 1.5s infinite;
}

/* Styles pour le tableau d'historique */
.history-table-container {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.history-table th {
    background: #f8f9fa;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.history-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: top;
}

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

.history-table .badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.badge-success {
    background: #d4edda;
    color: #155724;
}

.badge-danger {
    background: #f8d7da;
    color: #721c24;
}

.badge-warning {
    background: #fff3cd;
    color: #856404;
}

.badge-info {
    background: #d1ecf1;
    color: #0c5460;
}

.text-success {
    color: #28a745;
    font-weight: 600;
}

.text-danger {
    color: #dc3545;
    font-weight: 600;
}

.text-muted {
    color: #6c757d;
    font-size: 0.85em;
}

/* Styles pour les nouvelles sections */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.info-item {
    background: var(--light-color);
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.info-item label {
    display: block;
    font-size: 0.9em;
    color: var(--text-secondary);
    margin-bottom: 5px;
    font-weight: 600;
}

.info-value {
    font-weight: 600;
    color: var(--text-color);
    font-size: 1.1em;
}

.article-price {
    background: var(--success-light);
    color: var(--success-color);
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: 600;
    margin-top: 8px;
    display: inline-block;
    font-size: 0.9em;
}

.article-location {
    background: var(--info-light);
    color: var(--info-color);
    padding: 5px 10px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.location-display {
    background: var(--light-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
}

.location-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--text-color);
}

.location-details {
    font-size: 1.1em;
    color: var(--text-color);
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.location-note {
    font-size: 0.85em;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--warning-light);
    border-radius: 4px;
    border-left: 4px solid var(--warning-color);
}

.readonly-input {
    background-color: #f8f9fa;
    cursor: not-allowed;
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .info-grid {
        grid-template-columns: 1fr;
    }

    .article-location {
        font-size: 0.85em;
    }
}

/* Styles Quad pour accueil.html */
.quad-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.quad-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.accueil-view {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.quad-header {
    background: #495057;
    color: white;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.canvas-container {
    padding: 15px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    background: #fff;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.drawer-container {
    padding: 15px;
    height: 300px;
    overflow-y: auto;
    background: #f1f3f5;
}

/* Styles du tiroir */
.quad-drawer {
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.drawer-front {
    background: #6c757d;
    color: white;
    padding: 12px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quad-slot-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 8px;
    padding: 12px;
}

.quad-slot {
    background: #e9ecef;
    border: 2px solid #adb5bd;
    border-radius: 4px;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.quad-slot.occupied {
    background: #d4edda;
    border-color: #28a745;
}

.quad-slot.selected {
    background: #ffc107;
    border-color: #fd7e14;
    transform: scale(1.05);
}

/* Alternative : style qui correspond aux boutons existants */
.btn-inventaire {
    background: var(--primary-color, #4a90e2);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-inventaire:hover {
    background: var(--primary-dark, #357abd);
    color: white;
    text-decoration: none;
}

.article-photo {
    max-width: 120px !important;
    max-height: 120px !important;
}
.article-photo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.clickable-photo {
    transition: transform 0.2s;
}
.clickable-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.action-icon.blue {
    background: #dbeafe;
    color: var(--primary-color);
}

/* ===== STYLES POUR LES MODALS PROJETS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 20px;
}

.modal {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-large {
    max-width: 900px;
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex-grow: 1;
}

/* Styles pour la liste des projets dans le modal de sélection */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.project-item {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.2s;
    cursor: pointer;
}

.project-item:hover {
    border-color: #2563eb;
    background: #f1f5f9;
}

.project-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.project-item-header h4 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.project-number {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #495057;
}

.project-item-details {
    display: flex;
    gap: 15px;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 15px;
}

.project-item-details span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.select-project-btn {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.select-project-btn:hover {
    background: var(--primary-dark);
}

/* ===== STYLES SPÉCIFIQUES POUR MODAL DÉTAILS PROJET ===== */
.project-details-header {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.project-header-info h4 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 5px;
}

.project-header-meta {
    display: flex;
    gap: 15px;
    align-items: center;
}

.project-number {
    color: #495057;
    font-size: 0.9rem;
}

.project-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.project-status.active { background-color: #28a745; }
.project-status.ending { background-color: #ffc107; }
.project-status.overdue { background-color: #dc3545; }
.project-status.archived { background-color: #6c757d; }

/* Statistiques en colonnes */
.project-header-stats {
    display: flex;
    justify-content: space-between;
    position: relative;
    padding-bottom: 40px;
    margin-top: 15px;
}

.stats-column {
    flex: 1;
    max-width: 45%;
}

.column-label {
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
    color: #495057;
    font-size: 0.9rem;
}

.project-stat {
    text-align: center;
    padding: 10px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin-bottom: 10px;
}

.stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    display: block;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #2c3e50;
    display: block;
}

.project-stat-full {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
}

/* Tabs du projet */
.project-tab-buttons {
    display: flex;
    gap: 10px;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
    overflow-x: auto;
}

.project-tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s;
}

.project-tab-btn.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.project-tab-btn:hover:not(.active) {
    color: #495057;
}

.project-tab-content {
    display: none;
}

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

/* Contenu des onglets */
.project-info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 768px) {
    .project-info-grid {
        grid-template-columns: 1fr;
    }
}

.info-section {
    margin-bottom: 20px;
}

.info-section h5 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-section h5 i {
    color: #2563eb;
}

.info-item {
    display: flex;
    margin-bottom: 8px;
}

.info-item .label {
    width: 140px;
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.info-item .value {
    color: #2c3e50;
    font-size: 0.9rem;
    flex: 1;
}

/* Table des réservations */
.project-reservations-table {
    width: 100%;
    border-collapse: collapse;
}

.project-reservations-table th {
    background-color: #f8f9fa;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.85rem;
    white-space: nowrap;
}

.project-reservations-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

/* Badges de quantité */
.quantity-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
}

.quantity-badge.sortie {
    background-color: #dc3545;
    color: white;
}

.quantity-badge.reservation {
    background-color: #ffc107;
    color: #212529;
}

.quantity-badge.retour {
    background-color: #28a745;
    color: white;
}

/* Boutons d'action dans le tableau */
.btn-action {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #495057;
    transition: all 0.2s;
}

.btn-action:hover {
    background-color: #f8f9fa;
    border-color: #2563eb;
    color: #2563eb;
}

.btn-action.btn-small {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
}

/* Historique */
.history-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.empty-history {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.empty-history i {
    font-size: 48px;
    color: #dee2e6;
    margin-bottom: 10px;
}

/* Responsive pour modal projet */
@media (max-width: 768px) {
    .project-header-stats {
        flex-direction: column;
        gap: 15px;
    }

    .stats-column {
        max-width: 100%;
    }

    .project-tab-buttons {
        flex-direction: column;
    }

    .project-tab-btn {
        justify-content: center;
    }

    .project-reservations-table {
        display: block;
        overflow-x: auto;
    }
}

/* ===== CORRECTION DÉFINITIVE DES BOUTONS ===== */
#addReservationToProjectBtn,
#archiveProjectBtn,
#editProjectBtn,
#exportProjectBtn,
#projectDetailsModal .modal-actions button:not(.close-modal) {
    /* Styles de base FORCÉS */
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 100 !important;
    padding: 10px 20px !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    width: auto !important;
    height: auto !important;
    min-width: 140px !important;
    margin: 5px !important;
    border-radius: 8px !important;
    border: 1px solid !important;
    text-decoration: none !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s !important;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}

/* Styles spécifiques avec les bonnes couleurs */
#addReservationToProjectBtn {
    background: #2563eb !important;
    color: white !important;
    border-color: #1d4ed8 !important;
}

#archiveProjectBtn,
#editProjectBtn {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

#exportProjectBtn {
    background: #10b981 !important;
    color: white !important;
    border-color: #059669 !important;
}

/* Le bouton Fermer */
#projectDetailsModal .modal-actions button.btn-secondary:last-child {
    background: #f1f5f9 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
}

/* Effets hover */
#addReservationToProjectBtn:hover {
    background: #1d4ed8 !important;
    transform: translateY(-1px) !important;
}

#archiveProjectBtn:hover,
#editProjectBtn:hover {
    background: #e2e8f0 !important;
}

#exportProjectBtn:hover {
    background: #059669 !important;
    transform: translateY(-1px) !important;
}

#projectDetailsModal .modal-actions button.btn-secondary:last-child:hover {
    background: #e2e8f0 !important;
}

/* ===== NOUVELLE SECTION SCANNER/RECHERCHE ===== */

.project-return-search-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
    border: 1px solid #e9ecef;
}

.search-header {
    margin-bottom: 20px;
    text-align: center;
}

.search-header h4 {
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 18px;
}

.search-subtitle {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

.search-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.search-option {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #dee2e6;
    transition: transform 0.2s, box-shadow 0.2s;
}

.search-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.option-icon {
    font-size: 32px;
    color: #3498db;
    margin-bottom: 15px;
    text-align: center;
}

.option-content h5 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 16px;
}

.option-content p {
    color: #6c757d;
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

.search-input-group .search-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.search-input-group .btn-primary {
    padding: 10px 15px;
    font-size: 14px;
    white-space: nowrap;
}

/* Résultats de recherche */
.search-results-container {
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    max-height: 400px;
    overflow-y: auto;
}

.results-header {
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.results-header h5 {
    margin: 0;
    color: #2c3e50;
    font-size: 16px;
}

#resultsCount {
    background: #e9ecef;
    color: #495057;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.results-list {
    padding: 15px;
}

.article-result-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.2s;
}

.article-result-item:last-child {
    border-bottom: none;
}

.article-result-item:hover {
    background: #f8f9fa;
    border-radius: 6px;
}

.article-result-image {
    flex-shrink: 0;
}

.article-result-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    cursor: pointer;
}

.article-result-image .no-image {
    width: 60px;
    height: 60px;
    background: #e9ecef;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 20px;
}

.article-result-info {
    flex: 1;
    min-width: 0;
}

.article-result-info h6 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-result-details {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #6c757d;
}

.article-result-details span {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 10px;
}

.article-result-actions {
    flex-shrink: 0;
}

.article-result-actions .btn-primary {
    padding: 8px 15px;
    font-size: 13px;
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.no-results i {
    font-size: 40px;
    margin-bottom: 15px;
    color: #adb5bd;
}

.no-results p {
    margin: 0;
    font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
    .search-options {
        grid-template-columns: 1fr;
    }

    .article-result-item {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }

    .article-result-info h6 {
        text-align: center;
    }

    .article-result-details {
        justify-content: center;
    }
}

/* Bouton Démarrer le scan */
#scanArticleForReturnBtn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

#scanArticleForReturnBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

#scanArticleForReturnBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.4);
}

#scanArticleForReturnBtn i {
    font-size: 16px;
}

/* Bouton Ajouter dans les résultats */
.add-article-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    min-width: 100px;
    box-shadow: 0 3px 10px rgba(76, 175, 80, 0.3);
}

.add-article-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.5);
    background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 100%);
}

.add-article-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3);
}

.add-article-btn i {
    font-size: 14px;
}

/* Style pour les boutons dans les résultats */
.article-result-actions .add-article-btn {
    margin: 0;
    width: 100%;
}

/* Style différent pour les articles sans flèche */
.article-result-item.no-arrow .add-article-btn {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    box-shadow: 0 3px 10px rgba(255, 152, 0, 0.3);
}

.article-result-item.no-arrow .add-article-btn:hover {
    background: linear-gradient(135deg, #F57C00 0%, #FF9800 100%);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.5);
}

/* Bouton Secondaire (Fermer/Annuler) */
.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.5);
    background: linear-gradient(135deg, #495057 0%, #6c757d 100%);
    color: white;
    text-decoration: none;
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(108, 117, 125, 0.3);
}

/* Bouton Fermer spécifique dans les modals */
.modal-actions .btn-secondary {
    min-width: 120px;
}

/* Bouton Fermer dans l'en-tête des modals */
.modal-header .close-modal {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-header .close-modal:hover {
    background: #f8f9fa;
    color: #dc3545;
    transform: rotate(90deg);
}

/* Style cohérent pour tous les boutons .close-modal */
button.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px 15px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

button.close-modal:hover {
    background: #f8f9fa;
    color: #495057;
}

/* Bouton Danger (Confirmer la sortie/Suppression) */
.btn-danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.4);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.6);
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    color: white;
}

.btn-danger:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(231, 76, 60, 0.4);
}

.btn-danger:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.3);
}

.btn-danger:disabled {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    color: #9e9e9e;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-danger:disabled:hover {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    transform: none;
    box-shadow: none;
}

/* Bouton dans les popups de stock */
.stock-popup .btn-danger {
    width: 100%;
    margin-top: 10px;
}

/* Bouton dans les footers de modal */
.modal-footer .btn-danger,
.popup-footer .btn-danger {
    min-width: 150px;
}

/* Bouton Success (Confirmer l'entrée/Validation) */
.btn-success {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
}

.btn-success:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.4);
}

.btn-success:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.3);
}

.btn-success:disabled {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    color: #9e9e9e;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-success:disabled:hover {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    transform: none;
    box-shadow: none;
}

/* Bouton dans les popups de stock */
.stock-popup .btn-success {
    width: 100%;
    margin-top: 10px;
}

/* Bouton dans les footers de modal */
.modal-footer .btn-success,
.popup-footer .btn-success {
    min-width: 150px;
}

/* Bouton Warning (Créer la réservation/Avertissement) */
.btn-warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(243, 156, 18, 0.4);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.6);
    background: linear-gradient(135deg, #e67e22 0%, #f39c12 100%);
    color: white;
}

.btn-warning:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(243, 156, 18, 0.4);
}

.btn-warning:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.3);
}

.btn-warning:disabled {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    color: #9e9e9e;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-warning:disabled:hover {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    transform: none;
    box-shadow: none;
}

/* Bouton dans les popups de réservation */
.stock-popup .btn-warning {
    width: 100%;
    margin-top: 10px;
}

/* Bouton dans les footers de modal */
.modal-footer .btn-warning,
.popup-footer .btn-warning {
    min-width: 150px;
}

/* Bouton Rechercher dans le modal Détails du projet */
#searchArticleForReturnBtn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    min-width: 120px;
    box-shadow: 0 3px 10px rgba(52, 152, 219, 0.3);
}

#searchArticleForReturnBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.5);
    background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
}

#searchArticleForReturnBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

#searchArticleForReturnBtn i {
    font-size: 14px;
}

/* Style spécifique pour le groupe de recherche */
.search-input-group .btn-primary {
    border-radius: 0 6px 6px 0;
    height: 44px;
}

.search-input-group .search-input {
    border-radius: 6px 0 0 6px;
    border-right: none;
}

/* Responsive */
@media (max-width: 768px) {
    .search-input-group {
        flex-direction: column;
    }

    .search-input-group .search-input {
        border-radius: 6px;
        border-right: 1px solid #ced4da;
        margin-bottom: 10px;
    }

    .search-input-group .btn-primary {
        border-radius: 6px;
        height: auto;
        width: 100%;
    }
}

/* Bouton Confirmer dans le modal d'ajout simple */
#confirmSimpleAdd {
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.4);
}

#confirmSimpleAdd:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.6);
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

#confirmSimpleAdd:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(46, 204, 113, 0.4);
}

#confirmSimpleAdd:disabled {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    color: #9e9e9e;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

#confirmSimpleAdd:disabled:hover {
    background: linear-gradient(135deg, #e0e0e0 0%, #bdbdbd 100%);
    transform: none;
    box-shadow: none;
}

/* Style dans les modals */
.simple-return-modal .btn-primary {
    width: 100%;
    margin-top: 15px;
}

.simple-return-modal .modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.simple-return-modal .modal-actions .btn-primary {
    flex: 1;
}

.simple-return-modal .modal-actions .btn-secondary {
    flex: 1;
}

/* Style spécifique pour le bouton Annuler dans les modals */
.modal-actions .btn-secondary.close-modal {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    border: 2px solid transparent;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 100px;
    box-shadow: 0 2px 6px rgba(149, 165, 166, 0.3);
    height: 40px;
}

.modal-actions .btn-secondary.close-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.5);
    background: linear-gradient(135deg, #7f8c8d 0%, #95a5a6 100%);
    color: white;
    border-color: #95a5a6;
}

.modal-actions .btn-secondary.close-modal:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(149, 165, 166, 0.3);
}

/* Style dans les modals simples */
.simple-return-modal .modal-actions .btn-secondary.close-modal {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 3px 10px rgba(231, 76, 60, 0.3);
}

.simple-return-modal .modal-actions .btn-secondary.close-modal:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.5);
    border-color: #e74c3c;
}

/* Style pour le bouton Annuler dans les popups de stock */
.stock-popup .btn-secondary.close-modal {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    width: 100%;
    margin-top: 10px;
}

/* Responsive pour les boutons Annuler */
@media (max-width: 768px) {
    .modal-actions .btn-secondary.close-modal {
        width: 100%;
        margin-top: 10px;
    }
}

/* S'assurer que tous les boutons dans .modal-actions ont la même taille */
.modal-actions .btn-primary,
.modal-actions .btn-secondary,
.modal-actions .btn-success,
.modal-actions .btn-danger,
.modal-actions .btn-warning {
    padding: 10px 20px;
    font-size: 13px;
    min-width: 100px;
    height: 40px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

/* Ajuster les icônes pour correspondre */
.modal-actions .btn-primary i,
.modal-actions .btn-secondary i,
.modal-actions .btn-success i,
.modal-actions .btn-danger i,
.modal-actions .btn-warning i {
    font-size: 14px;
}

/* Bouton Vue stock 3D spécial */
.admin-btn[data-id="vuestock"] {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: 2px solid #8e44ad;
    position: relative;
    overflow: hidden;
}

.admin-btn[data-id="vuestock"]:hover {
    background: linear-gradient(135deg, #8e44ad 0%, #9b59b6 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.4);
}

.admin-btn[data-id="vuestock"]::after {
    content: '3D';
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

/* Cacher les cartes d'actions par défaut si nécessaire */
.action-card {
    display: none; /* Par défaut cachées */
}

/* Les cartes seront affichées dynamiquement par JavaScript */
.action-card[style*="display: block"] {
    display: block !important;
}

/* Style pour le message d'alerte */
.alert-message.info {
    background-color: #e3f2fd;
    color: #1976d2;
    padding: 15px;
    border-radius: 8px;
    margin: 20px;
    text-align: center;
}

.alert-message.info i {
    margin-right: 10px;
    font-size: 18px;
}

.alert-message.info span {
    vertical-align: middle;
}

/* Message pour plan BASIC */
.alert-info-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #6c757d;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    gap: 16px;
    align-items: center;
    margin: 20px 0;
}

.alert-info-card i {
    font-size: 2rem;
    color: #6c757d;
}

.alert-info-card h4 {
    margin: 0 0 8px 0;
    color: #495057;
}

.alert-info-card p {
    margin: 0 0 4px 0;
    color: #6c757d;
}

.alert-info-card small {
    color: #adb5bd;
}
