/* FirstCRM - Main Stylesheet */

/* ===== VARIABLES CSS ===== */
:root {
    /* Colors */
    --primary-color: #0d6efd;
    --primary-dark: #0056b3;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    
    /* Kanban specific */
    --kanban-bg: #f0f2f5;
    --kanban-card-bg: #ffffff;
    --kanban-shadow: 0 1px 3px rgba(0,0,0,0.12);
    --kanban-card-shadow: 0 1px 2px rgba(0,0,0,0.1);
    --kanban-hover-bg: #ddeeff;
    
    /* Modal */
    --modal-overlay-bg: rgba(0, 0, 0, 0.6);
    --modal-shadow: 0 5px 15px rgba(0,0,0,0.3);
    
    /* Spacing */
    --kanban-gap: 20px;
    --card-radius: 8px;
    --small-radius: 4px;
}

/* ===== UTILITY CLASSES ===== */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

/* Dashboard container for proper Kanban scrolling */
.dashboard-container {
    width: 100%;
    overflow-x: hidden; /* Prevent document-level horizontal scroll */
}

.kanban-container {
    width: 100%;
    position: relative;
}

/* Add scroll indicators */
.kanban-container::before,
.kanban-container::after {
    content: '';
    position: absolute;
    top: var(--kanban-gap);
    bottom: calc(var(--kanban-gap) + 15px);
    width: 30px;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.kanban-container::before {
    left: 0;
    background: linear-gradient(to right, rgba(248, 249, 250, 0.9) 0%, rgba(248, 249, 250, 0.6) 70%, transparent 100%);
    box-shadow: inset -10px 0 15px -10px rgba(0, 0, 0, 0.1);
}

.kanban-container::after {
    right: 0;
    background: linear-gradient(to left, rgba(248, 249, 250, 0.9) 0%, rgba(248, 249, 250, 0.6) 70%, transparent 100%);
    box-shadow: inset 10px 0 15px -10px rgba(0, 0, 0, 0.1);
}

/* Show left indicator when not at start */
.kanban-container.can-scroll-left::before {
    opacity: 1;
}

/* Show right indicator when not at end */
.kanban-container.can-scroll-right::after {
    opacity: 1;
}

/* ===== NAVBAR STYLES ===== */
.navbar .navbar-toggler {
    border: none !important;
    padding: 4px 8px;
}

.navbar .navbar-toggler:focus {
    box-shadow: none;
}

.hover-text-white:hover {
    color: white !important;
}

.transition {
    transition: all 0.3s ease;
}

.navbar .dropdown-menu {
    border-radius: 8px;
    border: none;
    margin-top: 0.5rem;
}

.navbar .dropdown-item:hover {
    background-color: var(--light-color);
    border-radius: 6px;
}

.navbar .dropdown-item i {
    width: 16px;
    text-align: center;
}

/* ===== KANBAN BOARD ===== */
.kanban-board {
    display: flex;
    gap: var(--kanban-gap);
    padding: var(--kanban-gap) 0;
    min-height: 600px;
    overflow-x: auto;
    overflow-y: visible;
    /* Padding to allow for scrollbar and add some space */
    padding-bottom: calc(var(--kanban-gap) + 15px);
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(13, 110, 253, 0.3) rgba(13, 110, 253, 0.1);
    /* Smooth scrolling */
    scroll-behavior: smooth;
    /* Snap to columns for better UX */
    scroll-snap-type: x mandatory;
}

/* Webkit scrollbar styling for better appearance */
.kanban-board::-webkit-scrollbar {
    height: 8px;
}

.kanban-board::-webkit-scrollbar-track {
    background: rgba(13, 110, 253, 0.1);
    border-radius: 4px;
}

.kanban-board::-webkit-scrollbar-thumb {
    background: rgba(13, 110, 253, 0.3);
    border-radius: 4px;
    transition: background 0.3s ease;
}

.kanban-board::-webkit-scrollbar-thumb:hover {
    background: rgba(13, 110, 253, 0.5);
}

.kanban-column {
    /* Fixed minimum width to ensure consistent sizing */
    min-width: 280px;
    max-width: 320px;
    flex: 0 0 300px;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(13, 110, 253, 0.1);
    transition: all 0.3s ease;
    /* Snap alignment for smooth scrolling */
    scroll-snap-align: start;
}

.kanban-column:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.kanban-column.drag-over {
    background: linear-gradient(145deg, #e3f2fd 0%, #bbdefb 100%);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.kanban-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    padding: 15px 0 20px 0;
    border-bottom: 2px solid rgba(13, 110, 253, 0.1);
    gap: 12px;
    min-height: 80px; /* Hauteur minimale pour l'en-tête */
}

.kanban-header-title {
    width: 100%;
    text-align: left;
}

.kanban-header-title h3 {
    margin: 0;
    font-weight: 600;
    color: var(--dark-color);
    font-size: 1.1rem;
    line-height: 1.3;
    word-wrap: break-word;
    white-space: normal; /* Permet le retour à la ligne */
    max-width: 100%;
}

.kanban-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.kanban-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.kanban-header .badge {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 0.8rem;
    padding: 6px 12px;
    border-radius: 20px;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Styles pour les contrôles de réorganisation des colonnes */
.column-reorder-controls {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.move-column-btn {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 4px 6px;
    font-size: 0.75rem;
    color: var(--dark-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.move-column-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Styles pour les boutons d'édition et suppression de colonne */
.edit-column-btn,
.delete-column-btn {
    flex-shrink: 0;
    padding: 4px 8px;
    font-size: 0.75rem;
    min-width: 32px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.edit-column-btn:hover,
.delete-column-btn:hover {
    transform: scale(1.05);
}

.edit-column-btn {
    margin-right: 4px;
}

.opportunity-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--info-color) 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.opportunity-card:hover::before {
    transform: scaleX(1);
}

.opportunity-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.opportunity-card.dragging {
    transform: rotate(5deg);
    z-index: 1000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.card-header .amount {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--success-color);
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.1) 0%, rgba(25, 135, 84, 0.05) 100%);
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid rgba(25, 135, 84, 0.2);
}

/* Card Actions - Better layout for amount and edit button */
.card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    min-width: 0;
}

/* Improved Edit Button */
.btn-edit-opportunity {
    background: rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(13, 110, 253, 0.2);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    color: var(--primary-color);
    font-size: 12px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    opacity: 0.8;
}

.btn-edit-opportunity:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
    opacity: 1;
}

.btn-edit-opportunity:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

/* Improved card header layout */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 12px;
}

.card-header h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark-color);
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Better spacing for opportunity cards */
.opportunity-card {
    background: linear-gradient(145deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid rgba(0,0,0,0.06);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-height: 140px;
}

/* Nouvelle structure verticale pour les cartes */
.card-header-vertical {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.card-title-section {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.card-title-section h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--dark-color);
    line-height: 1.4;
    flex: 1;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.card-amount-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-contacts-section,
.card-reminders-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.section-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.amount-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0;
}

.amount-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0;
}

.contacts-list,
.reminders-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.contact-chip {
    display: inline-block;
    background: linear-gradient(135deg, #6f42c1 0%, #8e5cd6 100%);
    color: white;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(111, 66, 193, 0.3);
    white-space: nowrap;
}

/* Styles pour les badges de rappels */
.reminders-list .badge {
    font-size: 0.65rem;
    padding: 3px 6px;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    text-align: center;
    vertical-align: baseline;
}

.reminders-list .badge.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.reminders-list .badge.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    color: #212529;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

.reminders-indicator .badge i {
    font-size: 0.6rem;
    margin-right: 2px;
}

/* Enhanced fallback styles */
.reminders-indicator .bg-danger,
.reminders-indicator .badge.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%) !important;
    background-color: #dc3545 !important; /* Fallback */
    color: white !important;
    border-color: #dc3545 !important;
    animation: pulse-danger 2s infinite;
}

.reminders-indicator .bg-warning,
.reminders-indicator .badge.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%) !important;
    background-color: #ffc107 !important; /* Fallback */
    color: #212529 !important;
    border-color: #ffc107 !important;
}

/* Ensure visibility even without Bootstrap */
.badge {
    display: inline-block;
    padding: 0.375em 0.75em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

@keyframes pulse-danger {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Legacy reminder styles (can be removed if not used elsewhere) */
.card-reminder {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
    padding: 8px;
    margin-top: 10px;
}

.reminder-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.reminder-note {
    color: var(--dark-color);
    font-size: 0.8rem;
    font-weight: 500;
}

.empty-column {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
    font-style: italic;
    background: linear-gradient(145deg, rgba(108, 117, 125, 0.05) 0%, rgba(108, 117, 125, 0.02) 100%);
    border-radius: 8px;
    border: 2px dashed rgba(108, 117, 125, 0.2);
}

.opportunity-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* ===== MODAL STYLES ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(0, 0, 0, 0.8) 100%);
    backdrop-filter: blur(8px);
    z-index: 1000;
    overflow-y: auto;
    display: none;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem 1rem;
    animation: modalFadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(13, 110, 253, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
}

.modal-header .modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header .modal-title::before {
    content: '';
    width: 4px;
    height: 24px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.btn-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    background: white;
}

/* ===== NOTES SECTION ===== */
.notes-section {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.notes-list {
    list-style-type: none;
    padding: 0;
    max-height: 200px;
    overflow-y: auto;
}

/* ===== RESPONSIVE KANBAN ===== */
@media (max-width: 768px) {
    .kanban-board {
        flex-direction: column;
        gap: 15px;
        overflow-x: visible;
        overflow-y: visible;
        padding-bottom: var(--kanban-gap);
    }
    
    .kanban-column {
        margin-bottom: 15px;
        min-width: unset;
        max-width: unset;
        flex: 1;
    }
    
    .opportunity-card {
        padding: 15px;
        min-height: 120px;
    }
    
    .card-header-vertical {
        gap: 10px;
    }
    
    .card-title-section {
        gap: 8px;
    }
    
    .card-title-section h4 {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .section-label,
    .amount-label {
        font-size: 0.75rem;
    }
    
    .amount-value {
        font-size: 1rem;
    }
    
    .contact-chip {
        font-size: 0.7rem;
        padding: 3px 6px;
    }
    
    .reminders-list .badge {
        font-size: 0.6rem;
        padding: 2px 5px;
    }
}

/* For medium screens - transition smoothly */
@media (min-width: 769px) and (max-width: 1200px) {
    .kanban-column {
        min-width: 250px;
        max-width: 280px;
        flex: 0 0 260px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes modalSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(-50px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

.opportunity-card {
    animation: fadeIn 0.3s ease;
}

/* ===== MODAL FORM STYLES ===== */
.modal-body .form-floating {
    margin-bottom: 20px;
}

.modal-body .form-floating > .form-control {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid rgba(13, 110, 253, 0.1);
    border-radius: 12px;
    padding: 16px 12px 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal-body .form-floating > .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    background: white;
    transform: translateY(-2px);
}

.modal-body .form-floating > label {
    color: #6c757d;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.modal-body .form-select {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid rgba(13, 110, 253, 0.1);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.modal-body .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
    background: white;
}

/* Enhanced sections within modal */
.modal-section {
    background: linear-gradient(145deg, rgba(13, 110, 253, 0.02) 0%, rgba(13, 110, 253, 0.05) 100%);
    border: 1px solid rgba(13, 110, 253, 0.1);
    border-radius: 15px;
    padding: 25px;
    margin: 25px 0;
    position: relative;
    overflow: hidden;
}

.modal-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--info-color) 100%);
}

.modal-section h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Modal buttons */
.modal-body .btn {
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modal-body .btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
}

.modal-body .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.modal-body .btn-danger {
    background: linear-gradient(135deg, var(--danger-color) 0%, #b02a37 100%);
    color: white;
}

.modal-body .btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.modal-body .btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
    color: white;
}

.modal-body .btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

.modal-body .btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
    border-radius: 8px;
}

/* Contact badges in modal */
.contact-badge-container {
    background: white;
    border: 1px solid rgba(13, 110, 253, 0.1);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.contact-badge-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border-color: var(--primary-color);
}

.contact-info {
    flex-grow: 1;
}

.contact-name {
    font-weight: 600;
    color: var(--dark-color);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.contact-details {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
}

.contact-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.contact-actions .btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.contact-actions .btn:hover {
    transform: scale(1.05);
}

.contact-actions .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.contact-actions .btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.contact-actions .btn-outline-danger:hover {
    background: var(--danger-color);
    border-color: var(--danger-color);
    color: white;
}

/* Legacy contact badge support */
.contact-badge {
    background: linear-gradient(135deg, var(--info-color) 0%, #66d9ef 100%);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(13, 202, 240, 0.3);
    transition: all 0.3s ease;
}

.contact-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 202, 240, 0.4);
}

.remove-contact-btn {
    background: rgba(255, 255, 255, 0.3);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.remove-contact-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.loading-spinner i {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
}

/* Notes section */
.notes-section {
    margin-top: 30px;
    padding-top: 25px;
    border-top: 2px solid rgba(13, 110, 253, 0.1);
}

.notes-section h3 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notes-list {
    background: linear-gradient(145deg, rgba(13, 110, 253, 0.02) 0%, rgba(13, 110, 253, 0.05) 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(13, 110, 253, 0.1);
}

.note-item {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.note-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.note-item:last-child {
    margin-bottom: 0;
}

/* ===== FORM ENHANCEMENTS ===== */
.form-floating {
    position: relative;
}

.form-floating > .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* ===== BUTTON IMPROVEMENTS ===== */
.btn {
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

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

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

/* ===== REMINDERS PAGE STYLES ===== */
.reminders-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    padding: 30px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(13, 110, 253, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

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

.header-title i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.header-title h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.header-stats {
    display: flex;
    gap: 20px;
}

.stat-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* Reminder Cards */
.reminders-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.reminder-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(13, 110, 253, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reminder-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--info-color) 100%);
}

.reminder-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.reminder-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 15px;
}

.reminder-info {
    flex-grow: 1;
}

.reminder-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.reminder-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.reminder-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.reminder-date i {
    color: var(--primary-color);
}

.reminder-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reminder-status.badge-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 193, 7, 0.1) 100%);
    color: #856404;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.reminder-status.badge-danger {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.15) 0%, rgba(220, 53, 69, 0.1) 100%);
    color: #721c24;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.reminder-status.badge-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.15) 0%, rgba(25, 135, 84, 0.1) 100%);
    color: #0f5132;
    border: 1px solid rgba(25, 135, 84, 0.3);
}

.reminder-status i {
    font-size: 0.6rem;
}

.reminder-actions {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-shrink: 0;
}

.btn-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-decoration: none;
}

.btn-modern:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.btn-modern.btn-success {
    background: linear-gradient(135deg, var(--success-color) 0%, #146c43 100%);
    color: white;
    border-color: var(--success-color);
}

.btn-modern.btn-success:hover {
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
    color: white;
}

.btn-modern.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: transparent;
}

.btn-modern.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(13, 110, 253, 0.3);
}

.btn-modern.btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background: transparent;
}

.btn-modern.btn-outline-danger:hover {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.reminder-note {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(13, 110, 253, 0.02) 100%);
    border: 1px solid rgba(13, 110, 253, 0.1);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 15px;
}

.reminder-note i {
    color: var(--primary-color);
    font-size: 1.1rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.reminder-note span {
    color: var(--dark-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Empty State */
.empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.empty-state-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.empty-state-icon {
    margin-bottom: 30px;
}

.empty-state-icon i {
    font-size: 4rem;
    color: #6c757d;
    opacity: 0.6;
}

.empty-state h3 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.empty-state p {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Animations */
@keyframes fadeOut {
    from { 
        opacity: 1; 
        transform: translateY(0); 
    }
    to { 
        opacity: 0; 
        transform: translateY(-20px); 
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .header-title h1 {
        font-size: 2rem;
    }
    
    .reminder-card-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .reminder-actions {
        align-self: stretch;
        justify-content: center;
    }
    
    .btn-modern {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }
    
    .reminder-meta {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .reminders-header {
        padding: 20px;
        margin: 0 -15px 30px -15px;
        border-radius: 0;
    }
    
    .reminder-card {
        margin: 0 -15px;
        border-radius: 0;
        padding: 20px;
    }
    
    .reminder-actions {
        flex-direction: column;
    }
    
    .btn-modern {
        width: 100%;
    }
}

/* ===== CONTACTS PAGE STYLES ===== */
.contacts-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 20px;
    padding: 30px;
    color: white;
    margin-bottom: 30px;
    box-shadow: 0 8px 30px rgba(13, 110, 253, 0.2);
}

.contacts-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.contacts-header .header-title {
    display: flex;
    align-items: center;
    gap: 15px;
}

.contacts-header .header-title i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.9);
}

.contacts-header .header-title h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    color: white;
}

.contacts-header .header-actions {
    display: flex;
    align-items: center;
    gap: 25px;
}

.contacts-header .header-stats {
    display: flex;
    gap: 20px;
}

.contacts-header .stat-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    min-width: 120px;
}

.contacts-header .stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 5px;
}

.contacts-header .stat-label {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

.add-contact-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    padding: 20px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 15px;
    min-width: 120px;
    min-height: 84px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-align: center;
}

.add-contact-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.2);
}

/* ===== SEARCH BAR STYLES ===== */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border: 2px solid rgba(13, 110, 253, 0.1);
    border-radius: 15px;
    padding: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15), 0 8px 30px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--primary-color);
    font-size: 1.1rem;
    z-index: 2;
    pointer-events: none;
}

.search-input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 18px 60px 18px 55px;
    font-size: 1rem;
    color: var(--dark-color);
    outline: none;
    border-radius: 15px;
}

.search-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.search-clear {
    position: absolute;
    right: 15px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--danger-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.search-clear:hover {
    background: var(--danger-color);
    color: white;
    transform: scale(1.1);
}

.search-results-info {
    margin-top: 15px;
    text-align: center;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(13, 110, 253, 0.02) 100%);
    border: 1px solid rgba(13, 110, 253, 0.1);
    border-radius: 10px;
    animation: fadeIn 0.3s ease;
}

.no-search-results {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 40vh;
    animation: fadeIn 0.3s ease;
}

/* Contact Cards */
.contacts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.contact-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid rgba(13, 110, 253, 0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--info-color) 100%);
}

.contact-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.contact-card-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 20px;
    min-height: 60px;
}

.contact-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.contact-info {
    flex-grow: 1;
}

.contact-name {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.contact-company {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.contact-company i {
    color: var(--primary-color);
    font-size: 0.8rem;
}

.contact-actions {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    flex-shrink: 0;
    min-width: 160px;
    justify-content: flex-end;
}

.contact-actions .btn-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-decoration: none;
    min-width: 70px;
    min-height: 40px;
    white-space: nowrap;
    box-sizing: border-box;
}

.contact-actions .btn-modern:hover {
    transform: translateY(-2px);
    text-decoration: none;
}

.contact-actions .btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background: transparent;
}

.contact-actions .btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.contact-actions .btn-outline-danger {
    color: var(--danger-color);
    border-color: var(--danger-color);
    background: transparent;
}

.contact-actions .btn-outline-danger:hover {
    background: var(--danger-color);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.contact-detail {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(13, 110, 253, 0.02) 100%);
    border: 1px solid rgba(13, 110, 253, 0.1);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.contact-detail:hover {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08) 0%, rgba(13, 110, 253, 0.05) 100%);
    border-color: rgba(13, 110, 253, 0.2);
}

.contact-detail i {
    color: var(--primary-color);
    font-size: 1rem;
    width: 16px;
    text-align: center;
    flex-shrink: 0;
}

.contact-detail span {
    color: var(--dark-color);
    font-size: 0.95rem;
    font-weight: 500;
}

/* Empty State for Contacts */
.contacts-container + .empty-state,
.container-fluid .empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.contacts-container + .empty-state .empty-state-content,
.container-fluid .empty-state .empty-state-content {
    text-align: center;
    max-width: 400px;
    padding: 40px;
}

.contacts-container + .empty-state .empty-state-icon,
.container-fluid .empty-state .empty-state-icon {
    margin-bottom: 30px;
}

.contacts-container + .empty-state .empty-state-icon i,
.container-fluid .empty-state .empty-state-icon i {
    font-size: 4rem;
    color: #6c757d;
    opacity: 0.6;
}

.contacts-container + .empty-state h3,
.container-fluid .empty-state h3 {
    color: var(--dark-color);
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.contacts-container + .empty-state p,
.container-fluid .empty-state p {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Responsive Design for Contacts */
@media (max-width: 768px) {
    .search-container {
        margin: 0 -15px;
    }
    
    .search-bar {
        border-radius: 10px;
        margin: 0 15px;
    }
    
    .search-input {
        padding: 15px 50px 15px 45px;
        font-size: 0.95rem;
    }
    
    .search-icon {
        left: 15px;
        font-size: 1rem;
    }
    
    .search-clear {
        right: 10px;
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .contacts-header .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .contacts-header .header-title h1 {
        font-size: 2rem;
    }
    
    .contacts-header .header-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .contacts-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .contact-card-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .contact-actions {
        align-self: stretch;
        justify-content: center;
    }
    
    .contact-actions .btn-modern {
        flex: 1;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .contacts-header {
        padding: 20px;
        margin: 0 -15px 30px -15px;
        border-radius: 0;
    }
    
    .contact-card {
        margin: 0 -15px;
        border-radius: 0;
        padding: 20px;
    }
    
    .contact-actions {
        flex-direction: column;
    }
    
    .contact-actions .btn-modern {
        width: 100%;
    }
    
    /* Kanban responsif pour petits écrans */
    .kanban-header {
        min-height: 70px;
        gap: 10px;
        padding: 12px 0 16px 0;
    }
    
    .kanban-header-title h3 {
        font-size: 1rem;
        line-height: 1.2;
    }
    
    .kanban-header-controls {
        gap: 8px;
    }
    
    .kanban-header-actions {
        gap: 6px;
    }
    
    .kanban-header .badge {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
    .column-reorder-controls {
        gap: 2px;
    }
    
    .move-column-btn,
    .edit-column-btn,
    .delete-column-btn {
        font-size: 0.7rem;
        min-width: 24px;
        height: 24px;
        padding: 2px 4px;
    }
    
    .edit-column-btn {
        margin-right: 2px;
    }
}
