:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 75px;
    --topbar-height: 75px;
    
    /* Palette avec Orange dominant pour plus de gaieté */
    --orange-primary: #FF6B35;
    --orange-hover: #FF8C61;
    --orange-light: #FFE5DC;
    --orange-dark: #E55A28;
    --orange-bg: #fdfaf9;
    
    --black-primary: #0F0F0F;
    --black-secondary: #1A1A1A;
    --black-tertiary: #2D2D2D;
    
    --gray-50: #FAFAFA;
    --gray-100: #F5F5F5;
    --gray-200: #E8E8E8;
    --gray-300: #D4D4D4;
    --gray-400: #A3A3A3;
    --gray-500: #737373;
    --gray-600: #525252;
    
    --white: #FFFFFF;
    
    /* Couleurs sémantiques */
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --info-color: #3B82F6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
    background-color: var(--orange-bg);
    overflow-x: hidden;
    color: var(--black-primary);
    line-height: 1.6;
}

/* ========== LOADING SCREEN ========== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--orange-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.loading-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--white);
    animation: spin 0.8s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite;
    margin-bottom: 24px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: var(--white);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* ========== SIDEBAR ========== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--orange-primary);
    color: var(--white);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 4px 0 20px rgba(255, 107, 53, 0.15);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 24px;
    background: var(--orange-dark);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    white-space: nowrap;
    overflow: hidden;
    text-align: center;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar.collapsed .sidebar-header {
    padding: 24px 12px;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    letter-spacing: -0.5px;
    color: var(--white);
}

.sidebar.collapsed .sidebar-header h3 {
    font-size: 0;
}

.sidebar.collapsed .sidebar-header small {
    display: none;
}

.sidebar-header .header-icon {
    font-size: 1.75rem;
    display: none;
    color: var(--white);
}

.sidebar.collapsed .sidebar-header .header-icon {
    display: block;
}

/* ========== SIDEBAR MENU ========== */
.sidebar-menu {
    padding: 16px 0;
    list-style: none;
    margin: 0;
}

.sidebar-menu li {
    position: relative;
    margin: 4px 12px;
}

.sidebar-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    white-space: nowrap;
    overflow: hidden;
    position: relative;
    font-size: 0.95rem;
    font-weight: 500;
}

.sidebar.collapsed .sidebar-menu li {
    margin: 4px 8px;
}

.sidebar.collapsed .sidebar-menu li a {
    padding: 12px;
    justify-content: center;
}

.sidebar-menu li a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

.sidebar-menu li.active > a {
    background: var(--white);
    color: var(--orange-primary);
    font-weight: 700;
}

.sidebar-menu li.active.has-submenu > a {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    border-left: 3px solid var(--white);
}

.menu-active {
    background: rgba(255, 255, 255, 0.15);
}

.sidebar-menu .submenu li.active a {
    background: var(--white);
    color: var(--orange-primary);
    font-weight: 700;
}

.sidebar-menu .submenu li a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.sidebar-menu li a i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar.collapsed .sidebar-menu li a i {
    margin-right: 0;
}

.sidebar-menu li a .menu-text {
    opacity: 1;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-menu li a .menu-text {
    opacity: 0;
    position: absolute;
    left: -9999px;
}

/* ========== SUBMENU ========== */
.sidebar-menu .submenu {
    padding-left: 0;
    list-style: none;
    display: none;
    background: transparent;
    margin: 4px 0 0 0;
}

.sidebar.collapsed .sidebar-menu .submenu {
    display: none !important;
}

.sidebar-menu .submenu li {
    margin: 2px 0;
}

.sidebar-menu .submenu li a {
    padding: 10px 16px 10px 48px;
    font-size: 0.9rem;
}

.sidebar.collapsed .sidebar-menu .submenu li a {
    padding: 10px 12px;
    justify-content: center;
}

.sidebar-menu .has-submenu > a::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: auto;
    font-size: 0.75rem;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed .sidebar-menu .has-submenu > a::after {
    display: none;
}

.sidebar-menu .has-submenu.active > a::after {
    transform: rotate(180deg);
}

.sidebar-menu .has-submenu.active .submenu {
    display: block;
}

/* ========== TOOLTIP ========== */
.sidebar.collapsed .sidebar-menu li a:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--orange-dark);
    color: var(--white);
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    margin-left: 12px;
    animation: tooltipFadeIn 0.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50%) translateX(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) translateX(0);
    }
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-left: var(--sidebar-width);
    padding-top: var(--topbar-height);
    min-height: 100vh;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

.content-padding {
    padding: 24px;
}

/* ========== TOPBAR ========== */
.topbar {
    position: fixed;
    top: 0;
    left: var(--sidebar-width);
    right: 0;
    background: var(--white);
    padding: 20px 24px;
    box-shadow: 0 2px 12px rgba(255, 107, 53, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 999;
    height: var(--topbar-height);
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 2px solid var(--orange-primary);
}

.topbar.expanded {
    left: var(--sidebar-collapsed-width);
}

.toggle-sidebar {
    background: var(--orange-light);
    border: none;
    font-size: 1.2rem;
    color: var(--orange-primary);
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-sidebar:hover {
    background: var(--orange-primary);
    color: var(--white);
    transform: scale(1.05);
}

.toggle-sidebar-mobile {
    display: none;
}

.topbar-search {
    flex: 1;
    max-width: 500px;
    margin: 0 24px;
}

.search-input {
    border: 2px solid var(--orange-light);
    border-radius: 12px;
    padding: 10px 20px;
    width: 100%;
    background: var(--white);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--orange-primary);
    background: var(--white);
    box-shadow: 0 0 0 4px var(--orange-light);
}

.notifications {
    position: relative;
    margin-right: 16px;
}

.notifications .btn {
    position: relative;
    border: none;
    background: var(--orange-light);
    color: var(--orange-primary);
    font-size: 1.2rem;
    padding: 10px;
    border-radius: 10px;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notifications .btn:hover {
    background: var(--orange-primary);
    color: var(--white);
    transform: scale(1.05);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--danger-color);
    color: var(--white);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 2px solid var(--white);
}

.user-menu {
    position: relative;
}

.user-menu img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    margin-right: 10px;
    object-fit: cover;
    border: 2px solid var(--orange-primary);
}

/* ========== BREADCRUMB ========== */
.breadcrumb-section {
    background: var(--white);
    padding: 16px 24px;
    border-bottom: 1px solid var(--orange-light);
    margin-bottom: 24px;
    border-left: 4px solid var(--orange-primary);
}

.breadcrumb {
    margin: 0;
    background: none;
    padding: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "\f054";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    color: var(--orange-primary);
    font-size: 0.75rem;
}

/* ========== QUICK ACTIONS ========== */
.quick-actions {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
    border: 2px solid var(--orange-light);
}

.quick-actions h6 {
    margin-bottom: 16px;
    color: var(--orange-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 2px solid var(--orange-light);
    border-radius: 10px;
    text-decoration: none;
    color: var(--gray-600);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    font-weight: 500;
    background: var(--white);
}

.quick-action-btn:hover {
    background: var(--orange-primary);
    border-color: var(--orange-primary);
    color: var(--white);
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.quick-action-btn i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
}

/* ========== STAT CARDS ========== */
.stat-card {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid var(--orange-light);
    background: var(--white);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 24px rgba(255, 107, 53, 0.2);
    border-color: var(--orange-primary);
}

.stat-card .card-body {
    padding: 24px;
    position: relative;
}

.stat-card .stat-icon {
    font-size: 2.5rem;
    opacity: 0.2;
    position: absolute;
    right: 24px;
    top: 24px;
    color: var(--orange-primary);
}

.stat-card .stat-count {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 8px 0;
    color: var(--orange-primary);
    letter-spacing: -1px;
}

.stat-card .stat-title {
    color: var(--gray-500);
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.stat-card .stat-change {
    font-size: 0.85rem;
    margin-top: 8px;
    font-weight: 600;
}

.stat-change.positive {
    color: var(--success-color);
}

.stat-change.negative {
    color: var(--danger-color);
}

/* ========== PROGRESS CARDS ========== */
.progress-card {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
    border: 2px solid var(--orange-light);
}

.progress-card h6 {
    margin-bottom: 20px;
    color: var(--orange-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.progress-item {
    margin-bottom: 20px;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--gray-600);
}

.progress {
    height: 10px;
    border-radius: 5px;
    background: var(--orange-light);
    overflow: hidden;
}

.progress-bar {
    border-radius: 5px;
    background: var(--orange-primary);
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ========== TABLES ========== */
.table-responsive {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
    border: 2px solid var(--orange-light);
}

.table thead th {
    background: var(--orange-primary);
    border-bottom: none;
    padding: 16px;
    font-weight: 700;
    color: var(--white);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody td {
    padding: 16px;
    vertical-align: middle;
    border-bottom: 1px solid var(--orange-light);
    color: var(--gray-600);
    font-size: 0.95rem;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table tbody tr:hover {
    background-color: var(--orange-bg);
}

/* ========== BADGES ========== */
.badge-pending {
    background-color: var(--warning-color);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-approved {
    background-color: var(--success-color);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-rejected {
    background-color: var(--danger-color);
    color: var(--white);
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* ========== CARDS ========== */
.card {
    border: 2px solid var(--orange-light);
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
    background: var(--white);
}

.card-header {
    border-bottom: 2px solid var(--orange-light);
    padding: 20px 24px;
    background: var(--white);
    font-weight: 700;
    color: var(--orange-primary);
    font-size: 1.1rem;
}

.card-footer {
    border-top: 2px solid var(--orange-light);
    padding: 20px 24px;
    background: var(--orange-bg);
}

/* ========== BUTTONS ========== */
.btn {
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    font-size: 0.95rem;
}

.btn-primary {
    background-color: var(--orange-primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.3);
}

.bg-btn-warning {
    color: var(--white) !important;
    background-color: var(--warning-color) !important;
}

.bg-btn-warning:hover {
    background-color: #DC8D0B !important;
    transform: translateY(-1px);
}

/* ========== FILTER PANEL ========== */
.filter-panel {
    background: var(--white);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(255, 107, 53, 0.1);
    border: 2px solid var(--orange-light);
}

.filter-panel h6 {
    margin-bottom: 16px;
    color: var(--orange-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

/* ========== FILTER BUTTONS ========== */
#filtre-btn .btn {
    opacity: 0.5;
    filter: grayscale(60%);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid var(--orange-light);
}

#filtre-btn .btn.active {
    opacity: 1;
    filter: none;
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(255, 107, 53, 0.3);
    border-color: var(--orange-primary);
    background-color: var(--orange-primary) !important;
    color: var(--white) !important;
}

/* ========== COLOR INPUT ========== */
.color-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-control-color {
    width: 50px;
    height: 40px;
    padding: 4px;
    border-radius: 8px;
    border: 2px solid var(--orange-primary);
}

.remove-color {
    line-height: 1;
    padding: 8px 12px;
    border-radius: 8px;
}

/* ========== UTILITIES ========== */
.hidden-row {
    display: none;
}

.text-3d {
    font-size: 3rem;
    font-weight: 800;
    color: var(--orange-primary);
    transform-style: preserve-3d;
    text-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.popover-large {
    max-width: 600px !important;
    width: auto;
    font-size: 0.95rem;
    white-space: normal;
}

/* ========== SCROLLBAR ========== */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--orange-dark);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.5);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* ========== INPUT NUMBER ========== */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 992px) {
    .sidebar {
        left: calc(-1 * var(--sidebar-width));
        width: var(--sidebar-width) !important;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0;
    }

    .main-content.expanded {
        margin-left: 0;
    }

    .topbar {
        left: 0;
    }

    .topbar.expanded {
        left: 0;
    }

    .toggle-sidebar {
        display: none;
    }

    .toggle-sidebar-mobile {
        display: block;
    }

    .topbar-search {
        display: none;
    }
}

@media (max-width: 768px) {
    .content-padding {
        padding: 16px;
    }

    .topbar {
        padding: 16px;
    }

    .stat-card .card-body {
        padding: 20px;
    }

    .table-responsive {
        font-size: 0.9rem;
    }
}

/* ========== SIDEBAR OVERLAY ========== */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 107, 53, 0.2);
    backdrop-filter: blur(4px);
    z-index: 999;
    display: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-overlay.active {
    display: block;
}