/* Variables et Reset */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
    --info-color: #3498db;
    --light-bg: #f8f9fa;
    --border-color: #dee2e6;
    --text-dark: #2c3e50;
    --text-muted: #6c757d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
}

/* Navbar */
.navbar {
    height: 60px;
}

.navbar-brand {
    font-size: 1.5rem;
    letter-spacing: 0.5px;
}

/* Sidebar Menu - FORCE LA LARGEUR */
.sidebar-menu {
    width: 280px !important;
    min-width: 280px !important;
    max-width: 280px !important;
    background: white;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    height: 100%;
    flex-shrink: 0;
}

.sidebar-menu .nav {
    padding: 10px 0;
    width: 100% !important;
}

.sidebar-menu .nav.flex-column {
    width: 100% !important;
}

.sidebar-menu .nav-link {
    color: var(--text-dark);
    padding: 12px 20px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex !important;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
    width: 100% !important;
}

.sidebar-menu .nav-link:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.sidebar-menu .nav-link.active {
    background: linear-gradient(90deg, #e7f3ff 0%, transparent 100%);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.sidebar-menu .nav-link i {
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    margin-right: 8px;
}

/* Cards */
.card {
    border-radius: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-header {
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-weight: 500;
}

/* Tree View */
.tree-view {
    font-size: 14px;
}

.tree-item {
    margin: 2px 0;
    position: relative;
}

.tree-node {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.tree-node:hover {
    background-color: var(--light-bg);
}

.tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 8px;
    color: inherit;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.2s;
}

.tree-toggle:hover {
    background: rgba(0,0,0,0.05);
}

.tree-toggle i {
    font-size: 14px;
}

.tree-label {
    flex: 1;
    padding: 0 8px;
    line-height: 1.5;
}

.tree-children {
    display: none;
    margin-left: 24px;
    padding-left: 12px;
    border-left: 1px solid var(--border-color);
}

.tree-children.show {
    display: block;
}

/* Icons Colors */
.text-success {
    color: var(--success-color) !important;
}

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

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

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

/* Search Input */
#globalSearch {
    border-radius: 20px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    width: 100%;
}

#globalSearch:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.btn {
    border-radius: 6px;
    padding: 8px 20px;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

/* Alerts */
.alert {
    border-radius: 8px;
    border: none;
}

.alert-info {
    background: #e7f3ff;
    color: #0066cc;
}

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

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

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

/* Form Controls */
.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

/* Scrollbar */
.sidebar-menu::-webkit-scrollbar {
    width: 6px;
}

.sidebar-menu::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar-menu {
        position: fixed;
        left: -280px;
        top: 60px;
        height: calc(100vh - 60px);
        z-index: 1000;
        transition: left 0.3s ease;
    }

    .sidebar-menu.show {
        left: 0;
        box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    }

    .tree-children {
        margin-left: 16px;
    }
}

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

.tree-children.show {
    animation: fadeIn 0.2s ease;
}

/* Utilities */
.shadow-sm {
    box-shadow: 0 2px 4px rgba(0,0,0,0.08) !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

/* Loading State */
.loading {
    display: none;
}

.loading.show {
    display: inline-block;
}

/* Badge */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

/* Footer Signature */
.footer-signature {
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-signature p {
    text-align: center;
}

.footer-signature strong {
    font-weight: 600;
    color: #fff;
}