/**
 * LuxNetwork Design System
 * Design moderne et professionnel conforme à la charte graphique
 */

:root {
    /* Couleurs principales */
    --lux-orange: #e9520e;
    --lux-orange-dark: #c7410a;
    --lux-orange-light: #ff6b2e;
    --lux-orange-hover: #d6490c;
    
    /* Couleurs de texte */
    --lux-text-primary: #181c32;
    --lux-text-secondary: #70706f;
    --lux-text-muted: #6c757d;
    --lux-text-light: #ffffff;
    
    /* Couleurs de fond */
    --lux-bg-primary: #ffffff;
    --lux-bg-secondary: #f5f8fa;
    --lux-bg-tertiary: #fafafa;
    --lux-bg-dark: #1e1e2d;
    
    /* Bordures */
    --lux-border-color: #e4e6ef;
    --lux-border-radius: 0.475rem;
    --lux-border-radius-lg: 0.75rem;
    --lux-border-radius-pill: 50rem;
    
    /* Ombres */
    --lux-shadow-sm: 0 0.1rem 0.5rem rgba(0, 0, 0, 0.1);
    --lux-shadow-md: 0 0.25rem 1rem rgba(0, 0, 0, 0.15);
    --lux-shadow-lg: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
    --lux-shadow-orange: 0 0.25rem 0.75rem rgba(233, 82, 14, 0.3);
    
    /* Espacements */
    --lux-spacing-xs: 0.25rem;
    --lux-spacing-sm: 0.5rem;
    --lux-spacing-md: 1rem;
    --lux-spacing-lg: 1.5rem;
    --lux-spacing-xl: 2rem;
    --lux-spacing-xxl: 3rem;
    
    /* Typographie */
    --lux-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --lux-font-size-xs: 0.75rem;
    --lux-font-size-sm: 0.875rem;
    --lux-font-size-base: 1rem;
    --lux-font-size-lg: 1.125rem;
    --lux-font-size-xl: 1.25rem;
    --lux-font-size-2xl: 1.5rem;
    --lux-font-size-3xl: 1.75rem;
    --lux-font-size-4xl: 2.25rem;
    
    /* Transitions */
    --lux-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --lux-transition-fast: all 0.15s ease;
    --lux-transition-slow: all 0.5s ease;
    
    /* Sidebar */
    --lux-sidebar-width: 70px;
    --lux-sidebar-bg: var(--lux-orange);
    
    /* Z-Index System (Best Practice: Documented layers) */
    --z-index-base: 1;
    --z-index-dropdown: 1000;
    --z-index-sticky: 1020;
    --z-index-fixed: 1030;
    --z-index-modal-backdrop: 1040;
    --z-index-modal: 1060; /* Augmenté pour être sûr qu'il soit au-dessus du backdrop */
    --z-index-popover: 1060;
    --z-index-tooltip: 1070;
    --z-index-sidebar: 10;
    --z-index-sidebar-dropdown: 1000; /* Réduit pour ne pas bloquer les modals */
}

/* Bootstrap Modal Fixes */
.modal-backdrop {
    z-index: 1040 !important;
}

.modal {
    z-index: 1050 !important;
}

.modal-dialog {
    z-index: 1055 !important;
    pointer-events: none;
}

.modal-content {
    pointer-events: auto !important;
    position: relative;
    z-index: 1056 !important;
    background-color: var(--lux-bg-primary);
    border: 1px solid var(--lux-border-color);
    border-radius: var(--lux-border-radius-lg);
    box-shadow: var(--lux-shadow-lg);
}

/* Ensure all interactive elements inside modals are clickable */
.modal-content input,
.modal-content select,
.modal-content textarea,
.modal-content button,
.modal-content canvas,
.modal-content label,
.modal-content .form-control,
.modal-content .form-select,
.modal-content .form-check-input,
.modal-content .btn {
    pointer-events: auto !important;
    position: relative;
    z-index: 1057 !important;
}

.modal-body,
.modal-header,
.modal-footer {
    pointer-events: auto !important;
    position: relative;
    z-index: 1056 !important;
}

/* Remove isolation on wrappers when modal is open — prevents stacking context trap */
body.modal-open .app-main-wrapper,
body.modal-open .app-footer {
    isolation: auto !important;
    z-index: auto !important;
}

/* Hide sidebar dropdown when a modal is open */
body.modal-open .sidebar-dropdown-menu {
    display: none !important;
}

/* Reset et base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--lux-font-family);
    font-size: var(--lux-font-size-base);
    line-height: 1.6;
    color: var(--lux-text-primary);
    background-color: var(--lux-bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typographie */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--lux-text-primary);
    margin-bottom: var(--lux-spacing-md);
}

h1 { font-size: var(--lux-font-size-4xl); }
h2 { font-size: var(--lux-font-size-3xl); }
h3 { font-size: var(--lux-font-size-2xl); }
h4 { font-size: var(--lux-font-size-xl); }
h5 { font-size: var(--lux-font-size-lg); }
h6 { font-size: var(--lux-font-size-base); }

p {
    margin-bottom: var(--lux-spacing-md);
    color: var(--lux-text-secondary);
}

a {
    color: var(--lux-orange);
    text-decoration: none;
    transition: var(--lux-transition-fast);
}

a:hover {
    color: var(--lux-orange-dark);
}

/* Layout principal */
.app-root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.app-wrapper {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 100vh;
    overflow: visible;
    position: relative;
}

/* Sidebar gauche */
.app-sidebar-left {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--lux-sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--lux-orange) 0%, var(--lux-orange-dark) 100%);
    z-index: var(--z-index-sidebar);
    box-shadow: var(--lux-shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--lux-spacing-xl) 0;
    transition: var(--lux-transition);
    overflow: visible;
}

.sidebar-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--lux-border-radius);
    color: #ffffff !important;
    text-decoration: none;
    transition: var(--lux-transition);
    margin-bottom: var(--lux-spacing-md);
    position: relative;
}

.sidebar-icon i {
    font-size: 1.3rem;
    transition: var(--lux-transition-fast);
    color: #ffffff !important;
}

.sidebar-icon:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: #ffffff !important;
}

.sidebar-icon:hover i {
    color: #ffffff !important;
}

.sidebar-icon.active {
    background-color: var(--lux-bg-primary);
    color: var(--lux-orange) !important;
    box-shadow: var(--lux-shadow-sm);
}

.sidebar-icon.active i {
    color: var(--lux-orange) !important;
}

.sidebar-icon.active::after {
    content: '';
    position: absolute;
    left: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 30px;
    background-color: var(--lux-bg-primary);
    border-radius: 0 4px 4px 0;
}

/* Sidebar dropdown menu - Fixed positioning for better z-index control */
.sidebar-icon-wrapper {
    position: relative;
    overflow: visible;
}

.sidebar-dropdown-menu {
    position: fixed;
    min-width: 220px;
    background-color: var(--lux-bg-primary);
    border-radius: var(--lux-border-radius);
    box-shadow: var(--lux-shadow-lg);
    padding: var(--lux-spacing-xs);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: var(--lux-transition);
    z-index: var(--z-index-sidebar-dropdown);
    border: 1px solid var(--lux-border-color);
    pointer-events: none;
    /* Position will be set by JavaScript */
    left: 0;
    top: 0;
}

.sidebar-icon-wrapper:hover .sidebar-dropdown-menu,
.sidebar-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

.sidebar-dropdown-menu .dropdown-item {
    display: flex;
    align-items: center;
    padding: var(--lux-spacing-sm) var(--lux-spacing-md);
    color: var(--lux-text-primary);
    text-decoration: none;
    border-radius: var(--lux-border-radius);
    transition: var(--lux-transition-fast);
    font-size: var(--lux-font-size-sm);
    white-space: nowrap;
}

.sidebar-dropdown-menu .dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--lux-text-muted);
}

.sidebar-dropdown-menu .dropdown-item:hover {
    background-color: var(--lux-bg-secondary);
    color: var(--lux-orange);
}

.sidebar-dropdown-menu .dropdown-item:hover i {
    color: var(--lux-orange);
}

.sidebar-dropdown-menu .dropdown-item.active {
    background-color: rgba(233, 82, 14, 0.1);
    color: var(--lux-orange);
    font-weight: 600;
}

.sidebar-dropdown-menu .dropdown-item.active i {
    color: var(--lux-orange);
}

/* Sidebar droite */
.app-sidebar-right {
    position: fixed;
    top: 0;
    right: 0;
    width: var(--lux-sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, var(--lux-orange) 0%, var(--lux-orange-dark) 100%);
    z-index: var(--z-index-sidebar);
    box-shadow: var(--lux-shadow-md);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: var(--lux-spacing-xl) 0;
    transition: var(--lux-transition);
    overflow: visible;
}

/* Contenu principal */
.app-main-wrapper {
    margin-left: var(--lux-sidebar-width);
    margin-right: var(--lux-sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--lux-bg-secondary);
    position: relative;
    z-index: var(--z-index-base);
    isolation: isolate;
}

/* Header */
.app-header-dashboard {
    background-color: var(--lux-bg-primary);
    border-bottom: 1px solid var(--lux-border-color);
    padding: var(--lux-spacing-lg) var(--lux-spacing-xl);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: var(--z-index-sticky);
    box-shadow: var(--lux-shadow-sm);
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: var(--lux-transition-fast);
}

.header-logo:hover {
    transform: scale(1.02);
}

.header-logo img {
    height: 50px;
    width: auto;
    margin-right: var(--lux-spacing-sm);
}

.header-logo-text {
    color: var(--lux-text-primary);
    font-size: var(--lux-font-size-2xl);
    font-weight: 600;
    letter-spacing: -0.5px;
}

.header-logo-o {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: var(--lux-orange);
    border-radius: 50%;
    color: var(--lux-text-light);
    font-size: var(--lux-font-size-base);
    font-weight: 600;
    margin: 0 0.125rem;
}

.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 var(--lux-spacing-xl);
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--lux-border-color);
    border-radius: var(--lux-border-radius);
    font-size: var(--lux-font-size-sm);
    transition: var(--lux-transition-fast);
    background-color: var(--lux-bg-secondary);
}

.header-search input:focus {
    outline: none;
    border-color: var(--lux-orange);
    background-color: var(--lux-bg-primary);
    box-shadow: 0 0 0 3px rgba(233, 82, 14, 0.1);
}

.header-search i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--lux-text-muted);
    font-size: var(--lux-font-size-sm);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: var(--lux-spacing-md);
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--lux-bg-secondary);
    color: var(--lux-text-primary);
    text-decoration: none;
    transition: var(--lux-transition);
    position: relative;
}

.header-icon:hover {
    background-color: var(--lux-border-color);
    transform: scale(1.05);
}

.header-icon.active {
    background-color: var(--lux-orange);
    color: var(--lux-text-light);
}

.header-icon i {
    font-size: var(--lux-font-size-lg);
}

/* User Profile Dropdown */
.user-profile-dropdown {
    position: relative;
}

.user-profile-toggle {
    border: none;
    padding: 0;
    cursor: pointer;
    /* Hérite des styles de .header-icon */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--lux-bg-secondary);
    color: var(--lux-text-primary);
    text-decoration: none;
    transition: var(--lux-transition);
    position: relative;
}

.user-profile-toggle:hover {
    background-color: var(--lux-border-color);
    transform: scale(1.05);
}

.user-profile-toggle.active {
    background-color: var(--lux-orange);
    color: var(--lux-text-light);
}

.user-profile-toggle i {
    font-size: var(--lux-font-size-lg);
}

.user-profile-menu {
    animation: fadeIn 0.2s ease-out;
}

.user-profile-header {
    padding: var(--lux-spacing-md);
    border-bottom: 1px solid var(--lux-border-color);
    background-color: var(--lux-bg-secondary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--lux-orange);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    flex-shrink: 0;
}

.user-profile-items {
    padding: 0.25rem 0;
}

.user-profile-item {
    padding: 0.75rem var(--lux-spacing-md);
    color: var(--lux-text-primary);
    text-decoration: none;
    transition: var(--lux-transition-fast);
    display: flex;
    align-items: center;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.user-profile-item:hover {
    background-color: var(--lux-bg-secondary);
}

.user-profile-item i {
    width: 20px;
    color: var(--lux-text-secondary);
    transition: var(--lux-transition-fast);
}

.user-profile-item:hover i {
    color: var(--lux-orange);
}

/* Contenu */
.app-content-wrapper {
    flex: 1;
    padding: var(--lux-spacing-xl);
    background-color: var(--lux-bg-secondary);
}

/* Cartes */
.card {
    background-color: var(--lux-bg-primary);
    border: 1px solid var(--lux-border-color);
    border-radius: var(--lux-border-radius-lg);
    box-shadow: var(--lux-shadow-sm);
    margin-bottom: var(--lux-spacing-lg);
    transition: var(--lux-transition);
    overflow: hidden;
}

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

.card-header {
    padding: var(--lux-spacing-lg);
    border-bottom: 1px solid var(--lux-border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--lux-bg-primary);
}

.card-title {
    margin: 0;
    font-size: var(--lux-font-size-xl);
    font-weight: 700;
    color: var(--lux-orange);
    display: flex;
    align-items: center;
    gap: var(--lux-spacing-sm);
}

.card-body {
    padding: var(--lux-spacing-lg);
}

.card-footer {
    padding: var(--lux-spacing-lg);
    border-top: 1px solid var(--lux-border-color);
    background-color: var(--lux-bg-secondary);
}

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: var(--lux-font-size-base);
    font-weight: 600;
    border: none;
    border-radius: var(--lux-border-radius-pill);
    cursor: pointer;
    transition: var(--lux-transition);
    text-decoration: none;
    white-space: nowrap;
    gap: var(--lux-spacing-sm);
}

.btn-primary {
    background-color: var(--lux-orange);
    color: var(--lux-text-light);
    box-shadow: var(--lux-shadow-orange);
}

.btn-primary:hover {
    background-color: var(--lux-orange-dark);
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(233, 82, 14, 0.4);
}

.btn-secondary {
    background-color: var(--lux-bg-secondary);
    color: var(--lux-text-primary);
    border: 1px solid var(--lux-border-color);
}

.btn-secondary:hover {
    background-color: var(--lux-border-color);
    border-color: var(--lux-orange);
    color: var(--lux-orange);
}

.btn-outline {
    background-color: transparent;
    color: var(--lux-orange);
    border: 2px solid var(--lux-orange);
}

.btn-outline:hover {
    background-color: var(--lux-orange);
    color: var(--lux-text-light);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: var(--lux-font-size-sm);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: var(--lux-font-size-lg);
}

/* Formulaires */
.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: var(--lux-font-size-base);
    font-weight: 400;
    line-height: 1.5;
    color: var(--lux-text-primary);
    background-color: var(--lux-bg-primary);
    border: 1px solid var(--lux-border-color);
    border-radius: var(--lux-border-radius);
    transition: var(--lux-transition-fast);
}

.form-control:focus {
    outline: none;
    border-color: var(--lux-orange);
    box-shadow: 0 0 0 3px rgba(233, 82, 14, 0.1);
}

.form-control::placeholder {
    color: var(--lux-text-muted);
}

.form-input-underline {
    width: 100%;
    border: none;
    border-bottom: 1px solid var(--lux-border-color);
    padding: 0.75rem 0;
    font-size: var(--lux-font-size-base);
    background: transparent;
    color: var(--lux-text-primary);
    outline: none;
    transition: var(--lux-transition-fast);
}

.form-input-underline:focus {
    border-bottom-color: var(--lux-orange);
}

.form-input-underline-line {
    height: 2px;
    background-color: var(--lux-orange);
    width: 0;
    transition: width 0.3s ease;
    margin-top: -1px;
}

.form-input-underline:focus + .form-input-underline-line {
    width: 100%;
}

/* Tableaux */
.table {
    width: 100%;
    margin-bottom: 0;
    border-collapse: collapse;
}

.table thead th {
    padding: var(--lux-spacing-md) var(--lux-spacing-lg);
    text-align: left;
    font-weight: 600;
    color: var(--lux-text-primary);
    border-bottom: 2px solid var(--lux-border-color);
    background-color: var(--lux-bg-secondary);
}

.table tbody td {
    padding: var(--lux-spacing-md) var(--lux-spacing-lg);
    border-bottom: 1px solid var(--lux-border-color);
    color: var(--lux-text-secondary);
}

.table tbody tr:hover {
    background-color: var(--lux-bg-secondary);
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: var(--lux-font-size-xs);
    font-weight: 600;
    border-radius: var(--lux-border-radius-pill);
    white-space: nowrap;
}

.badge-primary {
    background-color: var(--lux-orange);
    color: var(--lux-text-light);
}

.badge-secondary {
    background-color: var(--lux-bg-secondary);
    color: var(--lux-text-primary);
    border: 1px solid var(--lux-border-color);
}

.badge-success {
    background-color: #d1e7dd;
    color: #0f5132;
}

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

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

.badge-info {
    background-color: #cff4fc;
    color: #055160;
}

/* Footer */
.app-footer {
    background-color: var(--lux-bg-primary);
    border-top: 1px solid var(--lux-border-color);
    padding: var(--lux-spacing-md) var(--lux-spacing-xl);
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: var(--lux-font-size-xs);
    color: var(--lux-text-secondary);
}

.footer-links {
    display: flex;
    gap: var(--lux-spacing-lg);
}

.footer-links a {
    color: var(--lux-text-secondary);
    text-decoration: none;
    transition: var(--lux-transition-fast);
}

.footer-links a:hover {
    color: var(--lux-orange);
}

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

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

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

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

.animate-slide-in {
    animation: slideIn 0.5s ease-out;
}

/* Dashboard spécifique */
.dashboard-title {
    margin-bottom: var(--lux-spacing-xxl);
}

.dashboard-title h1 {
    display: flex;
    align-items: center;
    gap: var(--lux-spacing-md);
    color: var(--lux-text-primary);
    font-size: var(--lux-font-size-3xl);
    font-weight: 700;
    margin-bottom: var(--lux-spacing-sm);
}

.dashboard-title h1 i {
    color: var(--lux-orange);
    font-size: var(--lux-font-size-xl);
}

.dashboard-title p {
    margin-left: 2.5rem;
    color: var(--lux-text-secondary);
    font-size: var(--lux-font-size-base);
    margin-bottom: 0;
}

.dashboard-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.dashboard-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--lux-spacing-xl);
    border: 1px solid var(--lux-border-color);
    border-radius: var(--lux-border-radius-lg);
    background-color: var(--lux-bg-primary);
    text-decoration: none;
    transition: var(--lux-transition);
    height: 100%;
    min-height: 200px;
}

.dashboard-widget:hover {
    border-color: var(--lux-orange);
    transform: translateY(-4px);
    box-shadow: var(--lux-shadow-md);
}

.dashboard-widget-icon {
    font-size: 3rem;
    color: var(--lux-orange);
    margin-bottom: var(--lux-spacing-md);
}

.dashboard-widget-title {
    font-size: var(--lux-font-size-lg);
    font-weight: 600;
    color: var(--lux-text-primary);
    margin-bottom: var(--lux-spacing-sm);
}

.dashboard-widget-value {
    font-size: var(--lux-font-size-4xl);
    font-weight: 700;
    color: var(--lux-orange);
    margin-bottom: var(--lux-spacing-sm);
}

.dashboard-widget-label {
    font-size: var(--lux-font-size-sm);
    color: var(--lux-text-secondary);
    text-align: center;
}

/* ========================================
   Page de login
   ======================================== */
.login-page {
    overflow: hidden;
    min-height: 100vh;
}

.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* --- Left panel (branding) --- */
.login-left-panel {
    flex: 1;
    background: linear-gradient(135deg, var(--lux-bg-tertiary) 0%, #f0f0f0 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-content-wrapper {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
}

.login-lion-graphic {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 45%;
    opacity: 0.06;
    background-image: url('/static/luxAsset/logo/Lion_origamie_colors.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left bottom;
    pointer-events: none;
}

.login-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-logo {
    margin-bottom: 2.5rem;
}

.login-logo img {
    height: auto;
    max-height: 280px;
    width: auto;
    max-width: 100%;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.08));
}

.login-title {
    color: var(--lux-orange);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.login-subtitle {
    color: var(--lux-text-secondary);
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.6;
    margin: 0;
}

/* --- Right panel (form) --- */
.login-right-panel {
    flex: 1;
    background: var(--lux-bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.login-form-wrapper {
    width: 100%;
    max-width: 420px;
}

/* --- Form inner --- */
.login-form-inner {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.login-form-logo {
    margin-bottom: 2.5rem;
    text-align: center;
}

.login-form-logo img {
    height: auto;
    width: 260px;
    max-width: 100%;
}

.login-form-title {
    color: var(--lux-text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    text-align: center;
}

/* --- OAuth buttons --- */
.login-oauth-buttons {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    margin-bottom: 1.5rem;
}

.login-oauth-btn {
    display: block;
}

.login-oauth-btn img {
    height: 40px;
    width: auto;
    display: block;
}

/* --- Separator --- */
.login-separator {
    display: flex;
    align-items: center;
    width: 100%;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.login-separator::before,
.login-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e4e6ef;
}

.login-separator span {
    color: #a1a5b7;
    font-weight: 500;
    font-size: 0.8125rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Form fields --- */
.login-field {
    width: 100%;
    margin-bottom: 1.25rem;
    position: relative;
}

/* --- Options row --- */
.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 1.75rem;
}

.login-remember {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--lux-text-secondary);
    user-select: none;
}

.login-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--lux-orange);
    cursor: pointer;
}

.login-forgot {
    color: var(--lux-orange);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s ease;
}

.login-forgot:hover {
    color: var(--lux-orange-dark);
    text-decoration: underline;
}

/* --- Submit button --- */
.login-submit {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
}

/* --- Flash messages --- */
.login-flash-messages {
    width: 100%;
    margin-bottom: 1.5rem;
}

/* Responsive */
@media (max-width: 991.98px) {
    .app-sidebar-left,
    .app-sidebar-right {
        transform: translateX(-100%);
    }
    
    .app-sidebar-right {
        transform: translateX(100%);
    }
    
    .app-main-wrapper {
        margin-left: 0;
        margin-right: 0;
    }
    
    .header-search {
        display: none;
    }
    
    .login-left-panel {
        display: none;
    }

    .login-right-panel {
        min-height: 100vh;
    }

    .login-wrapper {
        flex-direction: column;
    }
}

/* Utilitaires */
.text-orange {
    color: var(--lux-orange) !important;
}

.bg-orange {
    background-color: var(--lux-orange) !important;
}

.border-orange {
    border-color: var(--lux-orange) !important;
}

.shadow-orange {
    box-shadow: var(--lux-shadow-orange) !important;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
    background: var(--lux-text-muted);
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Button loading state */
.btn-loading {
    opacity: 0.8;
    pointer-events: none;
}

/* Button danger */
.btn-danger {
    background-color: #dc3545;
    color: var(--lux-text-light);
    border: none;
}

.btn-danger:hover {
    background-color: #bb2d3b;
    color: var(--lux-text-light);
}

/* Button warning */
.btn-warning {
    background-color: #ffc107;
    color: var(--lux-text-primary);
    border: none;
}

.btn-warning:hover {
    background-color: #e0a800;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
#toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 420px;
    width: 100%;
    pointer-events: none;
}

.si4-toast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    border-radius: var(--lux-border-radius);
    box-shadow: var(--lux-shadow-md);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-size: var(--lux-font-size-sm);
    line-height: 1.4;
}

.si4-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.si4-toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideOut {
    to { opacity: 0; transform: translateX(100%); }
}

.si4-toast-body {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex: 1;
    min-width: 0;
}

.si4-toast-body i {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.si4-toast-message {
    word-break: break-word;
}

.si4-toast-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.6;
    padding: 0 0 0 0.5rem;
    line-height: 1;
    flex-shrink: 0;
}

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

.si4-toast-success {
    background-color: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

.si4-toast-error {
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
}

.si4-toast-warning {
    background-color: #fff3cd;
    border: 1px solid #ffecb5;
    color: #664d03;
}

.si4-toast-info {
    background-color: #cff4fc;
    border: 1px solid #b6effb;
    color: #055160;
}

/* ============================================================
   LOADING OVERLAY
   ============================================================ */
.si4-loading {
    position: relative;
    min-height: 60px;
}

.si4-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

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

.spinner-border.text-orange {
    color: var(--lux-orange) !important;
}

/* ============================================================
   EMPTY STATE COMPONENT
   ============================================================ */
.si4-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--lux-spacing-xxl) var(--lux-spacing-xl);
    text-align: center;
}

.si4-empty-state i {
    font-size: 3rem;
    color: var(--lux-text-muted);
    margin-bottom: var(--lux-spacing-lg);
}

.si4-empty-state .si4-empty-title {
    font-size: var(--lux-font-size-lg);
    font-weight: 600;
    color: var(--lux-text-primary);
    margin-bottom: var(--lux-spacing-sm);
}

.si4-empty-state .si4-empty-text {
    font-size: var(--lux-font-size-sm);
    color: var(--lux-text-secondary);
    margin-bottom: var(--lux-spacing-lg);
    max-width: 400px;
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

/* Skip to content link */
.si4-skip-link {
    position: absolute;
    top: -100%;
    left: 1rem;
    z-index: 99999;
    padding: 0.5rem 1rem;
    background: var(--lux-orange);
    color: #fff !important;
    border-radius: var(--lux-border-radius);
    text-decoration: none;
    font-weight: 600;
}

.si4-skip-link:focus {
    top: 0.5rem;
}

/* Better focus indicators */
*:focus-visible {
    outline: 2px solid var(--lux-orange);
    outline-offset: 2px;
}

.btn:focus-visible {
    box-shadow: 0 0 0 3px rgba(233, 82, 14, 0.4);
}

/* Form validation styles */
.si4-field-error {
    display: block;
    color: #dc3545;
    font-size: var(--lux-font-size-xs);
    margin-top: 0.25rem;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

/* Required field indicator */
.required::after {
    content: ' *';
    color: #dc3545;
}

/* ============================================================
   CONTRAST FIXES (WCAG AA compliance)
   ============================================================ */

/* Fix muted text contrast - #a1a5b7 is too light on white */
.text-muted-accessible {
    color: #6c757d !important; /* 4.6:1 contrast ratio on white */
}

/* ============================================================
   RESPONSIVE IMPROVEMENTS
   ============================================================ */

/* Small screen breakpoint */
@media (max-width: 575.98px) {
    .app-content-wrapper {
        padding: var(--lux-spacing-md);
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--lux-spacing-sm);
    }

    /* Stack table actions vertically on mobile */
    .table-responsive .btn-group {
        flex-direction: column;
    }

    /* Toast full width on mobile */
    #toast-container {
        left: 0.5rem;
        right: 0.5rem;
        max-width: none;
    }

    .si4-toast {
        font-size: var(--lux-font-size-xs);
    }
}

/* Tablet breakpoint */
@media (max-width: 767.98px) {
    .header-search {
        display: none;
    }

    /* Hide non-essential table columns on tablet */
    .table .d-none-tablet {
        display: none !important;
    }
}

/* ============================================================
   FLASH MESSAGES (centralized)
   ============================================================ */
.si4-flash-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 600px;
    width: calc(100% - 2rem);
    pointer-events: none;
}

.si4-flash {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--lux-border-radius);
    box-shadow: var(--lux-shadow-md);
    pointer-events: auto;
    animation: flashSlideIn 0.3s ease-out;
    font-size: var(--lux-font-size-sm);
    line-height: 1.4;
}

.si4-flash-hiding {
    animation: flashSlideOut 0.3s ease forwards;
}

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

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

.si4-flash-icon {
    font-size: 1.125rem;
    flex-shrink: 0;
}

.si4-flash-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.si4-flash-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    opacity: 0.5;
    padding: 0;
    line-height: 1;
    color: inherit;
    flex-shrink: 0;
}

.si4-flash-close:hover { opacity: 1; }

.si4-flash-success {
    background-color: #d1e7dd;
    border: 1px solid #badbcc;
    color: #0f5132;
}

.si4-flash-danger {
    background-color: #f8d7da;
    border: 1px solid #f5c2c7;
    color: #842029;
}

.si4-flash-warning {
    background-color: #fff3cd;
    border: 1px solid #ffecb5;
    color: #664d03;
}

.si4-flash-info {
    background-color: #cff4fc;
    border: 1px solid #b6effb;
    color: #055160;
}

@media (max-width: 575.98px) {
    .si4-flash-container { max-width: none; }
    .si4-flash { font-size: var(--lux-font-size-xs); }
}

