/* =================================================================
   VARIABLES CSS ET CONFIGURATION
   ================================================================= */
:root {
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    /* Couleurs principales */
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --info: #0891b2;
    --light: #f8fafc;
    --dark: #1e293b;

    /* Couleurs neutres */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    /* Espacements */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Bordures */
    --border-radius: 0.5rem;
    --border-radius-sm: 0.25rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    --border-width: 1px;
    --border-color: var(--gray-200);

    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Transitions */
    --transition: all 0.15s ease-in-out;
    --transition-fast: all 0.1s ease-in-out;
    --transition-slow: all 0.3s ease-in-out;

    /* Typographie */
    --font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;

    /* Layout */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 70px;
    --max-width: 1200px;
}

/* =================================================================
   RESET ET BASE
   ================================================================= */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--gray-50);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.navbar {
    --bs-navbar-padding-y: 0.10rem;
    --bs-navbar-padding-x: 1rem;
    position: fixed;
    top: 0;
    width: 100%;
    overflow: visible !important;
    z-index: 1030;
}

@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }
}

/* =================================================================
   ÉCRAN DE CHARGEMENT
   ================================================================= */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    color: white;
    font-weight: 500;
}

.loading-screen .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* =================================================================
   LAYOUT PRINCIPAL
   ================================================================= */
.app-layout {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}

.app-header {
    height: var(--header-height);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: var(--border-width) solid var(--border-color);
    background: white;
    box-shadow: var(--shadow-sm);
}

.app-sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: var(--border-width) solid var(--border-color);
    transition: var(--transition-slow);
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}

.app-sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.app-sidebar.collapsed .nav-text {
    display: none;
}

.app-sidebar.collapsed .sidebar-footer {
    display: none;
}

.app-main {
    flex: 1;
    background-color: var(--gray-50);
    min-height: calc(100vh - var(--header-height));
    overflow-x: hidden;
}

.sidebar-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.sidebar-footer {
    margin-top: auto;
    border-top: var(--border-width) solid var(--border-color);
}

/* =================================================================
   NAVIGATION
   ================================================================= */
.nav-link {
    color: var(--gray-600);
    text-decoration: none;
    padding: 0.75rem 1rem;
    margin: 0.125rem 0;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    background-color: var(--gray-100);
    color: var(--primary);
    text-decoration: none;
    transform: translateX(2px);
}

.nav-link.active {
    background-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.nav-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--primary-light);
}

.nav-link i {
    width: 1.25rem;
    text-align: center;
    font-size: 1rem;
}

/* =================================================================
   CARTES ET COMPOSANTS
   ================================================================= */
.card {
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

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

.card-header {
    padding: 1.25rem;
    border-bottom: var(--border-width) solid var(--border-color);
    background-color: var(--gray-50);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    font-weight: 600;
}

.card-body {
    padding: 1.25rem;
}

.card-footer {
    padding: 1rem 1.25rem;
    border-top: var(--border-width) solid var(--border-color);
    background-color: var(--gray-50);
    border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
}

/* Stats Cards */
.card-stats {
    position: relative;
    overflow: hidden;
}

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

/* =================================================================
   BOUTONS
   ================================================================= */
.btn {
    font-family: inherit;
    font-weight: 500;
    border-radius: var(--border-radius);
    transition: var(--transition);
    border: var(--border-width) solid transparent;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn:hover::before {
    width: 100%;
    height: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

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

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

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

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

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

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

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: var(--font-size-lg);
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: var(--font-size-sm);
}

/* =================================================================
   FORMULAIRES
   ================================================================= */
.form-control,
.form-select {
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-size: var(--font-size-base);
    padding: 0.625rem 0.875rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
    outline: none;
}

.form-control-lg {
    padding: 0.875rem 1rem;
    font-size: var(--font-size-lg);
}

.form-control-sm {
    padding: 0.375rem 0.5rem;
    font-size: var(--font-size-sm);
}

.form-label {
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 0.2rem rgba(37, 99, 235, 0.25);
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    align-items: stretch;
}

.input-group-text {
    background-color: var(--gray-100);
    border: var(--border-width) solid var(--border-color);
    color: var(--gray-600);
    padding: 0.625rem 0.875rem;
}

/* =================================================================
   TABLEAUX
   ================================================================= */
.table {
    background: white;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table th {
    background-color: var(--gray-50);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
    color: var(--gray-700);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 0.75rem;
    border-top: none;
}

.table td {
    border-color: var(--border-color);
    vertical-align: middle;
    padding: 0.875rem 0.75rem;
}

.table-hover tbody tr:hover {
    background-color: var(--gray-50);
    transform: scale(1.001);
    transition: var(--transition-fast);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--gray-50);
}

/* =================================================================
   BADGES ET ÉTIQUETTES
   ================================================================= */
.badge {
    font-weight: 500;
    font-size: var(--font-size-xs);
    padding: 0.375rem 0.625rem;
    border-radius: var(--border-radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-status {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: var(--font-size-xs);
    font-weight: 600;
}

.badge-status.status-active {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-status.status-pending {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-status.status-inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

/* =================================================================
   PROGRESS BARS
   ================================================================= */
.progress {
    height: 0.5rem;
    border-radius: var(--border-radius);
    background-color: var(--gray-200);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transition: width 0.6s ease;
    border-radius: var(--border-radius);
}

.progress-lg {
    height: 1rem;
}

.progress-sm {
    height: 0.25rem;
}

/* =================================================================
   MODALES
   ================================================================= */
.modal {
    backdrop-filter: blur(4px);
}

.modal-content {
    border: none;
    border-radius: var(--border-radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border-bottom: none;
    padding: 1.5rem;
}

.modal-header .btn-close {
    filter: invert(1);
    opacity: 0.8;
}

.modal-header .btn-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: var(--border-width) solid var(--border-color);
    padding: 1rem 1.5rem;
    background-color: var(--gray-50);
}

/* =================================================================
   ALERTES ET NOTIFICATIONS
   ================================================================= */
.alert {
    border: none;
    border-radius: var(--border-radius-lg);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-primary {
    background-color: #dbeafe;
    color: #1e40af;
    border-left-color: var(--primary);
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left-color: var(--success);
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left-color: var(--warning);
}

.alert-danger {
    background-color: #fee2e2;
    color: #991b1b;
    border-left-color: var(--danger);
}

.alert-info {
    background-color: #cffafe;
    color: #155e75;
    border-left-color: var(--info);
}

/* Toast Notifications */
.toast-container {
    z-index: 9999;
}

.toast {
    border: none;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

/* =================================================================
   DROPDOWN ET MENUS
   ================================================================= */
.dropdown-menu {
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    min-width: 200px;
}

.dropdown-item {
    padding: 0.625rem 1rem;
    transition: var(--transition);
    color: var(--gray-700);
    font-weight: 500;
}

.dropdown-item:hover {
    background-color: var(--gray-100);
    color: var(--primary);
}

.dropdown-header {
    font-weight: 600;
    color: var(--gray-600);
    font-size: var(--font-size-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border-color: var(--border-color);
}

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

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

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

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

.spin {
    animation: spin 1s linear infinite;
}

/* =================================================================
   UTILITAIRES
   ================================================================= */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cursor-pointer {
    cursor: pointer;
}

.border-radius {
    border-radius: var(--border-radius);
}

.border-radius-lg {
    border-radius: var(--border-radius-lg);
}

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

.text-primary {
    color: var(--primary) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-info {
    color: var(--info) !important;
}

.bg-primary-light {
    background-color: rgba(37, 99, 235, 0.1);
}

.bg-success-light {
    background-color: rgba(5, 150, 105, 0.1);
}

.bg-warning-light {
    background-color: rgba(217, 119, 6, 0.1);
}

.bg-danger-light {
    background-color: rgba(220, 38, 38, 0.1);
}

.bg-info-light {
    background-color: rgba(8, 145, 178, 0.1);
}

/* États de chargement */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--gray-300);
    border-top: 2px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* =================================================================
   RESPONSIVE DESIGN
   ================================================================= */
@media (max-width: 768px) {
    .app-sidebar {
        position: fixed;
        top: var(--header-height);
        left: -100%;
        width: var(--sidebar-width);
        height: calc(100vh - var(--header-height));
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: var(--shadow-xl);
    }

    .app-sidebar.show {
        left: 0;
    }

    .app-main {
        margin-left: 0;
        width: 100%;
    }

    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .modal-dialog {
        margin: 1rem;
    }

    .table-responsive {
        border-radius: var(--border-radius-lg);
    }

    .btn {
        padding: 0.625rem 1rem;
    }

    .btn-lg {
        padding: 0.75rem 1.25rem;
    }

    .row {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
    }

    .col,
    [class*="col-"] {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

@media (max-width: 576px) {
    .app-header .navbar-brand {
        font-size: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .modal-body {
        padding: 1rem;
    }

    .form-control-lg {
        padding: 0.75rem 0.875rem;
        font-size: 1rem;
    }

    .btn-group-vertical .btn {
        margin-bottom: 0.25rem;
    }

    .table td,
    .table th {
        padding: 0.5rem 0.375rem;
        font-size: var(--font-size-sm);
    }

    .dropdown-menu {
        min-width: auto;
        width: 100%;
    }
}

/* =================================================================
   DARK MODE (Optionnel)
   ================================================================= */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #1e293b;
        --gray-100: #334155;
        --gray-200: #475569;
        --gray-300: #64748b;
        --gray-700: #e2e8f0;
        --gray-800: #f1f5f9;
        --gray-900: #f8fafc;
    }

    body {
        background-color: var(--gray-900);
        color: var(--gray-100);
    }

    .card,
    .app-header,
    .app-sidebar,
    .modal-content {
        background-color: var(--gray-800);
        border-color: var(--gray-700);
        color: var(--gray-100);
    }

    .table th {
        background-color: var(--gray-700);
        color: var(--gray-100);
    }

    .form-control,
    .form-select {
        background-color: var(--gray-700);
        border-color: var(--gray-600);
        color: var(--gray-100);
    }

    .form-control:focus,
    .form-select:focus {
        background-color: var(--gray-700);
        border-color: var(--primary);
        color: var(--gray-100);
    }

    .dropdown-menu {
        background-color: var(--gray-800);
        border-color: var(--gray-700);
    }

    .dropdown-item {
        color: var(--gray-100);
    }

    .dropdown-item:hover {
        background-color: var(--gray-700);
    }
}

/* =================================================================
   PRINT STYLES
   ================================================================= */
@media print {
    .app-sidebar,
    .app-header,
    .btn,
    .dropdown,
    .modal {
        display: none !important;
    }

    .app-main {
        margin-left: 0 !important;
        padding: 0 !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
        page-break-inside: avoid;
    }

    .table {
        border-collapse: collapse !important;
    }

    .table th,
    .table td {
        border: 1px solid #ddd !important;
        padding: 8px !important;
    }

    body {
        background: white !important;
        color: black !important;
        font-size: 12px !important;
    }

    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
}

/* =================================================================
   ACCESSIBILITY
   ================================================================= */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus-visible:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* =================================================================
   CUSTOM SCROLLBARS
   ================================================================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

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

/* =================================================================
   PERFORMANCE OPTIMIZATIONS
   ================================================================= */
.card,
.btn,
.nav-link {
    will-change: transform;
}

.app-sidebar {
    contain: layout style paint;
}

.app-main {
    contain: layout style;
}


/* ==========================================================
   CALENDRIER - Compatible avec ton thème existant
   ========================================================== */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-sm);
    min-height: 400px;
}

.calendar-day {
    background: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: var(--spacing-sm);
    transition: var(--transition-fast);
    display: flex;
    flex-direction: column;
}

.calendar-day:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.calendar-day-header {
    font-weight: 600;
    font-size: var(--font-size-sm);
    color: var(--gray-600);
    margin-bottom: var(--spacing-xs);
}

.calendar-day-number {
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--primary);
    margin-bottom: var(--spacing-xs);
}

.calendar-event {
    background: var(--bg-color, var(--primary-light));
    color: white;
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-xs);
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    box-shadow: var(--shadow-sm);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.calendar-event.type-success {
    background-color: var(--success);
}

.calendar-event.type-warning {
    background-color: var(--warning);
}

.calendar-event.type-danger {
    background-color: var(--danger);
}

.calendar-event.type-info {
    background-color: var(--info);
}

.calendar-empty {
    text-align: center;
    color: var(--gray-400);
    font-size: var(--font-size-sm);
    padding: var(--spacing-md);
}

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

@media (max-width: 480px) {
    .calendar-grid {
        grid-template-columns: 1fr;
    }
}

/* Reports Page Styles */
.timeline {
    position: relative;
}

.timeline-item {
    position: relative;
}

.timeline-icon {
    flex-shrink: 0;
}

/* Print Styles for Reports */
@media print {
    .btn,
    .card-header .btn,
    .navbar,
    .sidebar,
    #dateDebut,
    #dateFin,
    #typeFilter,
    .btn-group {
        display: none !important;
    }

    .card {
        page-break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }

    .container-fluid {
        padding: 0 !important;
    }

    canvas {
        max-height: 300px !important;
    }
}

/* Card hover effect */
.card-hover {
    transition: all 0.3s ease;
    cursor: pointer;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Chart containers */
canvas {
    max-height: 400px;
}

/* Performance metrics */
.progress {
    height: 6px;
    border-radius: 3px;
}

/* Stats cards */
.bg-primary.text-white,
.bg-success.text-white,
.bg-warning.text-white,
.bg-info.text-white {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

.bg-success.text-white {
    background: linear-gradient(135deg, var(--success) 0%, #10b981 100%) !important;
}

.bg-warning.text-white {
    background: linear-gradient(135deg, var(--warning) 0%, #f59e0b 100%) !important;
}

.bg-info.text-white {
    background: linear-gradient(135deg, var(--info) 0%, #06b6d4 100%) !important;
}

.text-white-50 {
    color: rgba(255, 255, 255, 0.7) !important;
}

.opacity-50 {
    opacity: 0.5;
}

/* Calendar Styles */
.calendar-day-view {
    animation: fadeIn 0.3s ease-out;
}

.timeline {
    position: relative;
    padding-left: 0;
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
    margin-left: 1rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.calendar-event-small {
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-event-small:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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

/* Status colors */
.bg-success {
    background-color: #198754 !important;
}

.bg-primary {
    background-color: #0d6efd !important;
}

.bg-danger {
    background-color: #dc3545 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
}

.bg-info {
    background-color: #0dcaf0 !important;
}

.bg-secondary {
    background-color: #6c757d !important;
}

.bg-success.bg-opacity-10 {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.bg-primary.bg-opacity-10 {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.bg-danger.bg-opacity-10 {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

.bg-warning.bg-opacity-10 {
    background-color: rgba(255, 193, 7, 0.1) !important;
}

.border-success {
    border-color: #198754 !important;
}

.border-primary {
    border-color: #0d6efd !important;
}

.border-danger {
    border-color: #dc3545 !important;
}

.border-warning {
    border-color: #ffc107 !important;
}

/* Today RDV Widget Styles */
#todayRdvWidget {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.rdv-item {
    background: linear-gradient(to right, rgba(255, 193, 7, 0.1), transparent);
    border-radius: 0.25rem;
    cursor: pointer;
}

.rdv-item:hover {
    background: linear-gradient(to right, rgba(255, 193, 7, 0.2), transparent);
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#todayRdvWidget .card {
    border-radius: 0.5rem;
    overflow: hidden;
}

#todayRdvWidget .card-body::-webkit-scrollbar {
    width: 6px;
}

#todayRdvWidget .card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#todayRdvWidget .card-body::-webkit-scrollbar-thumb {
    background: #ffc107;
    border-radius: 3px;
}

#todayRdvWidget .card-body::-webkit-scrollbar-thumb:hover {
    background: #e0a800;
}

#todayRdvWidget .btn-close {
    opacity: 0.7;
}

#todayRdvWidget .btn-close:hover {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #todayRdvWidget {
        left: 0;
        right: 0;
        padding: 0.5rem !important;
    }

    #todayRdvWidget .card {
        width: 100% !important;
    }
}


/* Activity Timeline Styles */
.timeline {
    position: relative;
    padding-left: 0;
}

.timeline-item {
    position: relative;
    animation: fadeInUp 0.5s ease-out;
}

.timeline-icon {
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-item:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin: -0.5rem;
}

/* Activity Colors */
.bg-primary {
    background-color: #2563eb !important;
}

.bg-success {
    background-color: #059669 !important;
}

.bg-info {
    background-color: #0891b2 !important;
}

.bg-warning {
    background-color: #f59e0b !important;
}

.bg-danger {
    background-color: #dc2626 !important;
}

/* Last Activity Banner */
.alert-info {
    background-color: #e0f2fe;
    border-color: #0891b2;
    color: #0c4a6e;
}

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

/* Scrollbar for activities */
.card-body::-webkit-scrollbar {
    width: 6px;
}

.card-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.card-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.card-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* RDV Card Styles */
.rdv-card {
    transition: all 0.2s ease;
}

.rdv-card:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Task Item Styles */
.task-item {
    transition: all 0.2s ease;
}

.task-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Fade Out Animation */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.8);
    }
}

/* Priority Colors */
.border-danger {
    border-color: #dc2626 !important;
}

.border-warning {
    border-color: #f59e0b !important;
}

.border-primary {
    border-color: #2563eb !important;
}

.bg-opacity-10 {
    --bs-bg-opacity: 0.1;
}

/* Last Activity Banner */
.alert-success, .alert-info {
    border-left: 4px solid;
    animation: slideInDown 0.5s ease-out;
}

.activity-icon-large {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Last Activity Widget */
.activity-icon {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.activity-icon:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Sidebar Activity */
#lastActivitySidebar {
    transition: all 0.3s ease;
}

#lastActivitySidebar:hover {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}

/* Highlighted Timeline Item */
.timeline-item.bg-light {
    animation: pulse 2s ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        background-color: #f8f9fa;
    }
    50% {
        background-color: #e9ecef;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Gradient backgrounds for stats */
.bg-gradient-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

/* Notification Bell */
.notification-dropdown {
    position: relative;
}

.notification-dropdown .badge {
    font-size: 0.65rem;
    padding: 0.25em 0.5em;
    animation: pulse 2s infinite;
}

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

/* Notification Modal */
.notification-group {
    margin-bottom: 0;
}

.notification-group-header {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    z-index: 10;
}

.notification-item {
    display: flex;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

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

.notification-unread {
    background-color: rgba(13, 110, 253, 0.05);
    border-left: 3px solid #0d6efd;
}

.notification-read {
    opacity: 0.7;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
    flex-shrink: 0;
}

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

.notification-title {
    font-size: 0.95rem;
    color: #212529;
}

.notification-message {
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.notification-time {
    font-size: 0.75rem;
}

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

/* Notification Toast */
.notification-toast {
    min-width: 300px;
    max-width: 400px;
}

.notification-toast .toast-body {
    white-space: normal;
}

/* Profile Styles */
.avatar-large {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 4px solid white;
}

.avatar-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
}

.profile-avatar {
    position: relative;
}

.list-group-item {
    border-left: none;
    border-right: none;
}

.list-group-item:first-child {
    border-top: none;
}

.list-group-item:last-child {
    border-bottom: none;
}

/* User Dropdown */
#userProfileDropdown {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    background: white;
    transition: all 0.2s ease;
}

#userProfileDropdown:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dropdown-menu {
    min-width: 250px;
    border-radius: 0.5rem;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 0.375rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

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

.dropdown-header {
    font-weight: 600;
    color: #212529;
}

/* Timeline */
.timeline {
    position: relative;
}

.timeline-item {
    position: relative;
}

.timeline-icon {
    font-size: 0.75rem;
}

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

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Card Hover Effect */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

/* Gradient backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.bg-gradient-info {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
}

/* Avatar Circle */
.avatar-circle {
    width: 35px;
    height: 35px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 600;
}


/*
adding for dropdown
*/
/* Badge styles */
#notificationBadge {
    font-size: 0.65rem;
    padding: 0.25em 0.45em;
    min-width: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* When count is zero - smaller and less prominent */
#notificationBadge.opacity-75 {
    opacity: 0.75;
    font-size: 0.6rem !important;
}

/* Gray badge for zero notifications */
.bg-secondary.badge {
    background-color: #6c757d !important;
}

/* Keep pulse animation only for unread */
.pulse-badge {
    animation: pulse 2s infinite;
}

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

/* Fix avatar circle visibility */
.user-profile-dropdown .btn-outline-primary {
    position: relative;
    z-index: 1;
    transition: all 0.2s ease;
    overflow: visible !important;
}

.user-profile-dropdown .btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.user-profile-dropdown .btn-outline-primary .fas.fa-user-circle {
    position: relative;
    z-index: 1;
}

/* Ensure dropdown doesn't cover the button */
.user-profile-dropdown .dropdown-menu {
    margin-top: 0.5rem !important;
    z-index: 1055 !important;
}

/* Avatar/Icon should always be visible */
.user-profile-dropdown .btn-outline-primary > * {
    position: relative;
    z-index: 1;
}

/* Fix notification bell button */
.notification-bell-dropdown .btn-link {
    position: relative;
    z-index: 1;
    overflow: visible !important;
}

/* Header container overflow fix */
.app-header .navbar {
    overflow: visible !important;
    position: relative;
}

.app-header .container-fluid {
    overflow: visible !important;
    position: relative;
}

.app-header .d-flex.align-items-center {
    overflow: visible !important;
    position: relative;
}

/* Dropdown containers */
.notification-bell-dropdown,
.user-profile-dropdown {
    position: relative;
    overflow: visible !important;
}

/* new header */
/* ================================
   HEADER STYLES
   ================================ */
.app-header {
    position: sticky;
    top: 0;
    z-index: 1040;
    overflow: visible !important;
    background: white;
}

.app-header .navbar {
    overflow: visible !important;
    position: relative;
}

.app-header .container-fluid {
    overflow: visible !important;
    position: relative;
}

/* ================================
   NOTIFICATION BELL DROPDOWN
   ================================ */
.notification-bell-dropdown {
    position: relative;
    overflow: visible !important;
}

.notification-bell-dropdown .btn-link {
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
    position: relative;
    z-index: 1;
    overflow: visible !important;
}

.notification-bell-dropdown .btn-link:hover {
    transform: scale(1.05);
    background: transparent;
}

.notification-bell-dropdown .btn-link:focus {
    box-shadow: none;
    outline: none;
}

/* ================================
   USER PROFILE DROPDOWN
   ================================ */
.user-profile-dropdown {
    position: relative;
    overflow: visible !important;
}

.user-profile-dropdown .btn-outline-primary {
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
    overflow: visible !important;
    padding: 0.5rem 1rem;
}

.user-profile-dropdown .btn-outline-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.user-profile-dropdown .btn-outline-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
    z-index: 2;
}

/* Ensure icon and text are visible */
.user-profile-dropdown .btn-outline-primary > * {
    position: relative;
    z-index: 1;
}

.user-profile-dropdown .fa-user-circle {
    font-size: 1.5rem;
    position: relative;
    z-index: 1;
}

/* User Profile Dropdown Menu */
.user-profile-dropdown .dropdown-menu {
    min-width: 280px;
    border-radius: 0.5rem;
    margin-top: 0.5rem !important;
    z-index: 1055 !important;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

/*.user-profile-dropdown .dropdown-header {*/
/*    padding: 0.75rem 1rem;*/
/*    background-color: #f8f9fa;*/
/*    font-weight: 600;*/
/*    font-size: 0.95rem;*/
/*}*/
.user-profile-dropdown .dropdown-header {
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    font-weight: 600;
    font-size: 0.95rem;
    color: #212529;
}

/* Dropdown Item Text - No hover effect */
.user-profile-dropdown .dropdown-item-text {
    padding: 0.5rem 1rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/*.user-profile-dropdown .dropdown-item {*/
/*    padding: 0.6rem 1rem;*/
/*    transition: all 0.2s ease;*/
/*}*/
.user-profile-dropdown .dropdown-item {
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
    color: #212529;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

/*.user-profile-dropdown .dropdown-item:hover {*/
/*    background-color: #f8f9fa;*/
/*    padding-left: 1.25rem;*/
/*}*/

.user-profile-dropdown .dropdown-item:active {
    background-color: #e9ecef;
    color: #212529;
}

.user-profile-dropdown .dropdown-item.text-danger:hover {
    background-color: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.user-profile-dropdown .dropdown-item:hover,
.user-profile-dropdown .dropdown-item:focus {
    background-color: #f8f9fa;
    color: #212529;
    padding-left: 1.25rem;
}


/*.user-profile-dropdown .dropdown-item i {*/
/*    width: 20px;*/
/*    text-align: center;*/
/*}*/
.user-profile-dropdown .dropdown-item i {
    width: 24px;
    text-align: center;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

/* ================================
   NOTIFICATION DROPDOWN
   ================================ */
.notification-dropdown {
    width: 380px;
    max-width: 90vw;
    border-radius: 0.5rem;
    border: none;
    margin-top: 0.5rem !important;
    z-index: 1055 !important;
    overflow: visible !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.notification-dropdown .dropdown-header {
    padding: 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    font-size: 1rem;
}

.notification-preview-list {
    max-height: 400px;
    overflow-y: auto;
}

/*.notification-preview-item {*/
/*    padding: 0.75rem 1rem;*/
/*    border-bottom: 1px solid #f1f3f5;*/
/*    transition: all 0.2s ease;*/
/*    cursor: pointer;*/
/*    white-space: normal;*/
/*}*/

.notification-preview-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f1f3f5;
    transition: all 0.2s ease;
    cursor: pointer;
    white-space: normal;
    text-decoration: none;
    color: inherit;
}


/*.notification-preview-item:hover {*/
/*    background-color: #f8f9fa;*/
/*}*/

.notification-preview-item:hover {
    background-color: #f8f9fa;
    text-decoration: none;
}

.notification-preview-item:active {
    background-color: #e9ecef;
}

.notification-preview-item:last-child {
    border-bottom: none;
}

.notification-preview-item.unread {
    background-color: rgba(13, 110, 253, 0.05);
    border-left: 3px solid #0d6efd;
}

.notification-preview-item.unread:hover {
    background-color: rgba(13, 110, 253, 0.1);
}

/* Notification text elements - ensure visibility */
.notification-preview-title {
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    color: #212529;
}

.notification-preview-message {
    font-size: 0.813rem;
    line-height: 1.4;
    margin-bottom: 0.25rem;
    word-wrap: break-word;
    color: #6c757d;
}

.notification-preview-time {
    font-size: 0.75rem;
    color: #6c757d;
}

/* Notification Footer Links */
.dropdown-footer {
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dropdown-footer .btn-link {
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.dropdown-footer .btn-link.text-primary {
    color: #fff !important;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

.dropdown-footer .btn-link.text-primary:hover {
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
    transform: translateY(-1px);
    text-decoration: none;
}

/*.dropdown-footer .btn-link.text-secondary {*/
/*    color: #6c757d !important;*/
/*}*/

.dropdown-footer .btn-link.text-secondary {
    color: #6c757d !important;
    background-color: transparent;
    border: 1px solid #dee2e6;
}

.dropdown-footer .btn-link.text-secondary:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    text-decoration: none;
}

.dropdown-footer .btn-sm {
    padding: 0.5rem 1rem !important;
}

.dropdown-footer .btn-link:hover {
    text-decoration: underline;
    opacity: 0.8;
}

/* ================================
   ENSURE TEXT VISIBILITY
   ================================ */

/* Force text color visibility */

.dropdown-item,
.dropdown-item:hover,
.dropdown-item:focus,
.dropdown-item:active {
    opacity: 1 !important;
}

.dropdown-item span,
.dropdown-item i {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Remove any transforms that might hide text */

.dropdown-menu * {
    transform: none !important;
}

/* Ensure dropdown content is readable */

.dropdown-menu {
    color: #212529;
}

.dropdown-menu .dropdown-item {
    white-space: normal;
    word-wrap: break-word;
}

/* ================================
   ACCESSIBILITY & FOCUS STATES
   ================================ */

.dropdown-item:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
    background-color: #f8f9fa;
}

/* Keyboard navigation */

.dropdown-item:focus {
    background-color: #f8f9fa;
    color: #212529;
}

/* ================================
   NOTIFICATION ICON
   ================================ */

.notification-icon-small {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 0.875rem;
    border-radius: 50%;
}

.notification-unread-indicator {
    width: 8px;
    height: 8px;
    background-color: #0d6efd;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
    align-self: center;
}

/* ================================
   BADGE STYLES
   ================================ */

#notificationBadge {
    font-size: 0.65rem;
    padding: 0.25em 0.45em;
    min-width: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Badge animations */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

.pulse-badge {
    animation: pulse 2s infinite;
}

/* Bell ring animation */
@keyframes ring {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(-12deg);
    }
    20%, 40% {
        transform: rotate(12deg);
    }
    50% {
        transform: rotate(0deg);
    }
}

.bell-ring {
    animation: ring 2s ease-in-out infinite;
    transform-origin: 50% 4px;
}

/* ================================
   DROPDOWN GENERAL STYLES
   ================================ */

.dropdown-menu {
    z-index: 1055 !important;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.dropdown-menu.show {
    display: block;
    position: absolute;
}

/* ================================
   RESPONSIVE STYLES
   ================================ */
@media (max-width: 768px) {
    .user-profile-dropdown .btn-outline-primary {
        padding: 0.4rem 0.8rem;
    }

    .user-profile-dropdown .btn-outline-primary .text-start {
        display: none;
    }

    .user-profile-dropdown .fa-user-circle {
        margin-right: 0 !important;
    }

    /*.user-profile-dropdown .dropdown-menu {*/
    /*    min-width: 250px;*/
    /*}*/
    /* Dropdown Menu Base Styles */
    .user-profile-dropdown .dropdown-menu {
        min-width: 280px;
        border-radius: 0.5rem;
        margin-top: 0.5rem !important;
        z-index: 1055 !important;
        border: 1px solid rgba(0, 0, 0, 0.1);
        box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
        padding: 0.5rem 0;
    }

    /* Dropdown Divider */
    .user-profile-dropdown .dropdown-divider {
        margin: 0.5rem 0;
        border-top: 1px solid #e9ecef;
    }

    .notification-dropdown {
        width: 100vw;
        max-width: calc(100vw - 2rem);
        right: 1rem !important;
        left: auto !important;
    }
}

/* ================================
   Z-INDEX HIERARCHY
   ================================ */
/* Ensure proper stacking */

.app-header {
    z-index: 1040;
}

.app-sidebar {
    z-index: 1030;
}

.app-main {
    z-index: 1;
}

.dropdown-menu {
    z-index: 1055 !important;
}

.modal {
    z-index: 1060;
}

.modal-backdrop {
    z-index: 1050;
}

/* ================================
   NOTIFICATION BADGE POSITIONING
   ================================ */

/* Position badge closer to the bell icon */

.notification-badge {
    position: absolute !important;
    top: 0 !important;
    right: -2px !important;
    font-size: 0.65rem !important;
    padding: 0.25em 0.5em !important;
    min-width: 18px !important;
    height: 18px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid white !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

/* Alternative positioning - top right corner of bell */

.notification-bell-dropdown .btn-link {
    position: relative !important;
    padding: 0.5rem !important;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.notification-bell-dropdown .fa-bell {
    position: relative;
    z-index: 1;
}

/* Badge pulse animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7),
        0 2px 4px rgba(0, 0, 0, 0.2);
    }
    70% {
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0),
        0 2px 4px rgba(0, 0, 0, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0),
        0 2px 4px rgba(0, 0, 0, 0.2);
    }
}

.pulse-badge {
    animation: pulse 2s infinite;
}

/* Bell ring animation */
@keyframes ring {
    0%, 100% {
        transform: rotate(0deg);
    }
    10%, 30% {
        transform: rotate(-12deg);
    }
    20%, 40% {
        transform: rotate(12deg);
    }
    50% {
        transform: rotate(0deg);
    }
}

.bell-ring {
    animation: ring 2s ease-in-out infinite;
    transform-origin: 50% 4px;
}

/* Notification Bell Dropdown */

.notification-bell-dropdown {
    position: relative;
    overflow: visible !important;
}

.notification-bell-dropdown .btn-link {
    text-decoration: none;
    transition: all 0.3s ease;
    border: none;
    background: none;
    z-index: 1;
    overflow: visible !important;
}

.notification-bell-dropdown .btn-link:hover {
    transform: scale(1.05);
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
}

.notification-bell-dropdown .btn-link:focus {
    box-shadow: none;
    outline: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
}

/* Fix user profile dropdown active state */

.user-profile-dropdown .btn-outline-primary:active,
.user-profile-dropdown .btn-outline-primary.active,
.user-profile-dropdown .btn-outline-primary.show,
.user-profile-dropdown .btn-outline-primary:focus {
    color: #0d6efd !important;
}

/* Ensure text inside button stays visible */

.user-profile-dropdown .btn-outline-primary:active *,
.user-profile-dropdown .btn-outline-primary.active *,
.user-profile-dropdown .btn-outline-primary.show *,
.user-profile-dropdown .btn-outline-primary:focus * {
    color: inherit !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Keep icon visible */

.user-profile-dropdown .btn-outline-primary i {
    color: #0d6efd !important;
}

/* Keep text visible in all states */

.user-profile-dropdown .btn-outline-primary .text-start,
.user-profile-dropdown .btn-outline-primary .fw-semibold,
.user-profile-dropdown .btn-outline-primary .text-muted {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Client Card Styles */
.client-card {
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.client-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.hover-shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Avatar Styles */
.avatar-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    flex-shrink: 0;
}

.avatar-circle-lg {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

/* Card Hover Overlay */
.card-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 123, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    color: white;
    z-index: 10;
}

.client-card:hover .card-hover-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
}

/* Contact Info */
.client-contact-info {
    min-height: 60px;
}

/* Min width helper */
.min-width-0 {
    min-width: 0;
}

/* View Toggle Buttons */
.view-toggle .btn {
    padding: 0.375rem 0.75rem;
}

.view-toggle .btn.active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .avatar-circle-lg {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .client-contact-info {
        font-size: 12px;
    }
}

/* RDV Card Styles */
.rdv-card {
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.rdv-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

.hover-shadow {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Avatar Styles */
.avatar-circle-sm {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
}

/* Date Badge */
.rdv-date-badge {
    min-width: 60px;
    border-radius: 8px;
}

/* Card Hover Overlay */
.card-hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 123, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
    color: white;
    z-index: 10;
}

.rdv-card:hover .card-hover-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
}

/* Contact Info */
.rdv-contact-info {
    min-height: 40px;
}

/* Min width helper */
.min-width-0 {
    min-width: 0;
}

/* View Toggle Buttons */
.btn-group[role="group"] .btn-check:checked + .btn {
    background-color: #0d6efd;
    color: white;
    border-color: #0d6efd;
}

/* Cursor pointer */
.cursor-pointer {
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .rdv-date-badge {
        min-width: 50px;
    }

    .rdv-contact-info {
        font-size: 11px;
    }
}

.rdv-timeline .rdv-item {
    transition: transform 0.2s, box-shadow 0.2s;
}

.rdv-timeline .rdv-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
}

.rdv-timeline .rdv-item.border-warning {
    animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(255, 193, 7, 0);
    }
}

/* Week view styles */
#weekRdvModal .col {
    min-width: 0;
}

#weekRdvModal .card {
    font-size: 0.85rem;
}

/* Filter tabs */
#todayRdvTabs .nav-link.active {
    border-bottom: 3px solid var(--bs-primary) !important;
    font-weight: 600;
}

#todayRdvTabs .nav-link:hover:not(.active) {
    background-color: rgba(0,0,0,0.05);
}

/* Pagination styles */
.pagination .page-link {
    min-width: 36px;
    text-align: center;
}

/* Sort header hover */
thead th a:hover {
    opacity: 0.8;
}

/* Avatar circle */
.avatar-circle {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Table row hover effect */
.table-hover tbody tr:hover {
    background-color: rgba(0, 123, 255, 0.05);
}

/* Filter card */
#usersTableContainer .card-body.py-2 {
    background-color: #f8f9fa;
}

/* Loading state */
#usersTableContainer.loading {
    opacity: 0.6;
    pointer-events: none;
}


.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bg-gradient-warning {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.bg-opacity-25 {
    opacity: 0.25;
}

.app-sidebar.collapsed .sidebar-toggle-btn i {
    transform: rotate(180deg);
}

/* =================================================================
   FIN DU FICHIER CSS
   ================================================================= */
