/**
 * AdminLTE 4 Compatibility CSS
 */

/* === VARIABLES CSS === */
:root {
    --lte-sidebar-width: 250px;
    --lte-sidebar-bg: #222d32;
    --lte-sidebar-color: #c2c7d0;
    --lte-sidebar-hover-bg: rgba(255, 255, 255, 0.1);
    --lte-sidebar-hover-color: #fff;
    --lte-sidebar-menu-active-bg: rgba(255, 255, 255, 0.1);
    --lte-sidebar-menu-active-color: #fff;
    --lte-sidebar-submenu-bg: transparent;
    --lte-sidebar-submenu-color: #c2c7d0;
    --lte-sidebar-submenu-hover-bg: rgba(255, 255, 255, 0.1);
    --lte-sidebar-submenu-hover-color: #fff;
    --lte-sidebar-header-color: #4b545c;
    --lte-sidebar-border-color: rgba(255, 255, 255, 0.1);
}

/* === SIDEBAR BRAND === */
.sidebar-brand {
    padding: 0.8rem 0.5rem;
    font-size: 1.25rem;
    line-height: inherit;
    white-space: nowrap;
    background-color: #fff;
    border-bottom: 1px solid rgba(0,0,0,.125);
}

.sidebar-brand .brand-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.sidebar-brand .brand-link:hover {
    opacity: 0.8;
}

.sidebar-brand .brand-image {
    max-height: 33px;
    width: auto;
    transition: all 0.3s ease;
}

/* Logo collapsed - visible when sidebar is collapsed */
.sidebar-brand .brand-image-collapsed {
    display: none;
}

/* Logo expanded - visible when sidebar is expanded (default) */
.sidebar-brand .brand-image-expanded {
    display: block;
}

/* When sidebar is collapsed */
.sidebar-collapse .sidebar-brand .brand-image-collapsed {
    display: block;
}

.sidebar-collapse .sidebar-brand .brand-image-expanded {
    display: none;
}

/* Legacy support */
.sidebar-brand .brand-text {
    font-weight: 400;
}

.sidebar-brand .brand-text img {
    max-height: 30px;
    width: auto;
}

/* === SIDEBAR MENU (Compact & Ergonomic) === */

/* Base du menu */
.sidebar-wrapper,
.sidebar-wrapper ul,
.sidebar-wrapper li,
.app-sidebar .sidebar-menu li,
.app-sidebar .sidebar-menu ul {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0;
}

.sidebar-wrapper .sidebar-menu {
    padding: 0.5rem 0;
}

.sidebar-wrapper .sidebar-menu > .nav-item {
    margin-bottom: 0;
}

.sidebar-wrapper .sidebar-menu > .nav-item > .nav-link {
    padding: 0.5rem 1rem;
    margin-bottom: 0;
    border-radius: 0;
    display: flex;
    align-items: center;
    transition: all 0.15s ease-in-out;
}

.sidebar-wrapper .sidebar-menu > .nav-item.menu-open .nav-link.active:not(:hover) {
    --lte-sidebar-menu-active-bg: transparent;
}

.sidebar-wrapper .sidebar-menu > .nav-item > .nav-link:active,
.sidebar-wrapper .sidebar-menu > .nav-item > .nav-link:focus {
    color: var(--lte-sidebar-color);
}

.sidebar-wrapper .sidebar-menu > .nav-item > .nav-link.active:not(:hover),
.sidebar-wrapper .sidebar-menu > .nav-item > .nav-link.active {
    color: var(--lte-sidebar-menu-active-color) !important;
    background-color: var(--lte-sidebar-menu-active-bg) !important;
}

.sidebar-wrapper .sidebar-menu > .nav-item.menu-open > .nav-link,
.sidebar-wrapper .sidebar-menu > .nav-item:hover > .nav-link,
.sidebar-wrapper .sidebar-menu > .nav-item > .nav-link:hover,
.sidebar-wrapper .sidebar-menu > .nav-item > .nav-link:focus {
    color: var(--lte-sidebar-hover-color) !important;
    background-color: var(--lte-sidebar-hover-bg) !important;
}

.sidebar-wrapper .sidebar-menu > .nav-item > .nav-treeview {
    background-color: var(--lte-sidebar-submenu-bg);
    padding: 0;
}

/* Headers du menu */
.sidebar-wrapper .nav-header {
    display: block;
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--lte-sidebar-header-color);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    background-color: inherit;
}

.sidebar-wrapper a,
.app-sidebar .nav-link,
.app-sidebar a {
    color: var(--lte-sidebar-color) !important;
    text-decoration: none !important;
}

/* Sous-menus */
.sidebar-wrapper .nav-treeview,
.sidebar-menu .nav-treeview {
    padding-left: 0;
    display: none;
}

.sidebar-menu .nav-item.menu-open > .nav-treeview {
    display: block;
}

.sidebar-wrapper .nav-treeview > .nav-item > .nav-link {
    color: var(--lte-sidebar-submenu-color);
    padding: 0.4rem 1rem 0.4rem 2.5rem;
    font-size: 0.9rem;
}

.sidebar-wrapper .nav-treeview > .nav-item > .nav-link:hover,
.sidebar-wrapper .nav-treeview > .nav-item > .nav-link:focus,
.sidebar-wrapper .nav-treeview > .nav-item > .nav-link.active,
.sidebar-wrapper .nav-treeview > .nav-item > .nav-link.active:hover,
.sidebar-wrapper .nav-treeview > .nav-item > .nav-link.active:focus {
    color: var(--lte-sidebar-submenu-hover-color);
    background-color: var(--lte-sidebar-submenu-hover-bg);
}

/* Icônes et texte */
.sidebar-menu .nav-link > i,
.sidebar-menu .nav-link > svg {
    margin-right: 0.5rem;
    font-size: 0.9rem;
    width: 1.2rem;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-menu .nav-link p {
    display: inline-block;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

/* === APP HEADER === */
.app-header {
    border-bottom: 1px solid #d2d6de;
    background-color: #fff !important;
    padding: 0 0.5rem;
}

.app-header .navbar-nav {
    align-items: center;
}

.app-header .nav-item {
    display: flex;
    align-items: center;
}

.app-header .nav-link {
    color: #333;
    padding: 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    transition: background-color 0.3s;
}

.app-header .nav-link:hover {
    background-color: rgba(0,0,0,0.05);
    border-radius: 0.25rem;
}

.app-header .nav-link i {
    font-size: 1rem;
}

/* User image in navbar */
.app-header .user-image {
    width: 25px;
    height: 25px;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* User menu dropdown */
.app-header .dropdown-menu {
    border: 1px solid rgba(0,0,0,.15);
    box-shadow: 0 6px 12px rgba(0,0,0,.175);
}

.user-header {
    padding: 10px;
    text-align: center;
    background-color: #3c8dbc;
    color: #fff;
}

.user-header img {
    z-index: 5;
    height: 90px;
    width: 90px;
    border: 3px solid;
    border-color: rgba(255,255,255,0.2);
    margin: 0 auto;
}

.user-header p {
    margin-top: 10px;
    margin-bottom: 5px;
    font-size: 17px;
}

.user-header small {
    display: block;
    font-size: 12px;
}

.user-body {
    padding: 15px;
    border-bottom: 1px solid #f4f4f4;
}

.user-footer {
    background-color: #f9f9f9;
    padding: 10px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: space-between;
}

.user-footer .btn {
    font-size: 12px;
}

/* === APP SIDEBAR === */
.app-sidebar {
    background-color: var(--lte-sidebar-bg);
    color: var(--lte-sidebar-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

.app-sidebar .sidebar-header-fixed {
    flex-shrink: 0;
    background: inherit;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.app-sidebar .sidebar-wrapper {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 1rem;
}

.app-sidebar .sidebar-scrollable {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
}

/* === Entity Selection & Search === */
.sidebar-entity-select,
.sidebar-search {
    padding: 0.75rem 1rem;
}

.sidebar-entity-select {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-search {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-entity-select .input-group,
.sidebar-search .input-group,
.global-entities .input-group {
    width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap !important;
}

.sidebar-entity-select .input-group-text,
.sidebar-search .input-group-text,
.global-entities .input-group-text {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-left: 0 !important;
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 0.5rem 0.75rem !important;
    display: flex !important;
    align-items: center !important;
}

.sidebar-entity-select input.form-control,
.sidebar-entity-select select.form-control,
.sidebar-search input.form-control,
.sidebar-search select.form-control,
.global-entities .select2-container,
.global-entities .select2-selection {
    background-color: rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
    font-size: 0.875rem !important;
    padding: 0.5rem 0.75rem !important;
    height: auto !important;
    border-radius: 0.25rem 0 0 0.25rem !important;
}

.sidebar-entity-select input.form-control::placeholder,
.sidebar-search input.form-control::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.sidebar-entity-select input.form-control:focus,
.sidebar-entity-select select.form-control:focus,
.sidebar-search input.form-control:focus,
.sidebar-search select.form-control:focus {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.1);
}

.sidebar-entity-select select.form-control option,
.sidebar-search select.form-control option {
    background-color: #2c3b41;
    color: #fff;
}

.global-entities .select2-container {
    flex: 1 !important;
    width: auto !important;
}

.global-entities .select2-selection__rendered {
    color: #fff !important;
    line-height: normal !important;
    padding: 0 !important;
}

.global-entities .select2-selection__arrow {
    height: 100% !important;
}

/* === User Panel === */
.user-panel {
    position: relative;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-panel .image {
    flex-shrink: 0;
}

.user-panel .image img {
    width: 2.5rem;
    height: 2.5rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.user-panel .info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 0.25rem;
}

.user-panel .info p {
    font-weight: 500;
    margin: 0;
    color: #fff;
    font-size: 0.9375rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-panel .info .user-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-panel .info .user-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8125rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    line-height: 1;
    transition: color 0.2s ease;
}

.user-panel .info .user-links a:hover {
    color: #fff;
}

.user-panel .info .user-links a i {
    font-size: 0.75rem;
}

.user-panel .info .user-links .text-success {
    color: #28a745 !important;
}

.user-panel .info .user-links .text-success:hover {
    color: #34ce57 !important;
}

.user-panel .info .user-links .text-danger {
    color: #dc3545 !important;
}

.user-panel .info .user-links .text-danger:hover {
    color: #e4606d !important;
}

/* === CONTENT === */
.app-content-header {
    padding: 15px;
    background-color: #fff;
    border-bottom: 1px solid #d2d6de;
}

.app-content-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 400;
}

.app-content {
    padding: 15px;
}

/* === FOOTER === */
.app-footer {
    background: #fff;
    padding: 15px;
    color: #444;
    border-top: 1px solid #d2d6de;
    font-size: 12px;
}

/* === BREADCRUMBS === */
.breadcrumb {
    background-color: transparent;
    padding: 5px 0;
    margin-bottom: 0;
}

/* === BADGES === */
.badge {
    font-size: 11px;
    font-weight: 400;
    padding: 3px 6px;
}

.navbar-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 4px;
    position: absolute;
    right: 5px;
    top: 9px;
}

/* === MODALS === */
.modal-backdrop {
    background-color: rgba(0, 0, 0, 0.3) !important;
    opacity: 1 !important;
}

.modal-backdrop.show {
    opacity: 0.3 !important;
}

.modal {
    background-color: transparent !important;
}

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

.modal-content {
    background-color: #fff !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    border-radius: 0.3rem;
}

.modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 0.75rem;
}

/* === BOUTONS === */
.btn-secondary,
.btn-outline-secondary {
    background-color: #6c757d !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

.btn-secondary:hover,
.btn-secondary:focus,
.btn-secondary:active,
.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    background-color: #5a6268 !important;
    border-color: #545b62 !important;
    color: #fff !important;
}

.btn-xs {
    padding: 0.125rem 0.5rem !important;
    font-size: 0.75rem !important;
    line-height: 1.5 !important;
    border-radius: 0.2rem !important;
}

.btn-group > .btn-secondary {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Dropdown icons */
.dropdown-toggle i:not(:first-child),
.dropdown-toggle .fa:not(:first-child),
.dropdown-toggle .fas:not(:first-child),
.btn-group .dropdown-toggle .fa-caret-down:not(:first-child),
.btn-group .dropdown-toggle .caret:not(:first-child) {
    display: none !important;
}

.dropdown-toggle i:first-child {
    margin-right: 0.25rem !important;
}

/* === INPUT GROUPS === */
.input-group-addon,
.input-group-text {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.375rem 0.75rem !important;
    min-width: fit-content !important;
    white-space: nowrap !important;
}

.input-group-addon i,
.input-group-text i {
    font-size: 1rem !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    display: inline-block !important;
    width: 1em !important;
    height: 1em !important;
    overflow: visible !important;
}

.input-group-addon i + i,
.input-group-text i + i {
    margin-left: 0.5rem !important;
}

.input-group-btn {
    position: relative !important;
    white-space: nowrap !important;
}

.input-group-btn .btn {
    position: relative !important;
}

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

.dropdown-menu {
    font-size: 14px;
}

.dropdown-item {
    padding: 10px 20px;
}

/* === TYPOGRAPHIE === */
html {
    font-size: 15px;
}

body {
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #495057;
    text-decoration: none;
}

a:hover {
    color: #212529;
    text-decoration: underline;
}

a:focus {
    outline: thin dotted;
    outline-offset: 2px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Source Sans Pro', sans-serif;
    font-weight: 500;
    line-height: 1.2;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

.form-control,
.btn,
table,
label {
    font-size: 0.875rem;
}

.card-body,
.card-header,
.card-footer {
    font-size: 1rem;
}

/* === INFO-BOX (AdminLTE 4) === */
.info-box {
    display: flex;
    min-height: 80px;
    background: #fff;
    padding: 0.75rem;
    position: relative;
    border-radius: 0.25rem;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.2);
    margin-bottom: 1rem;
}

.info-box-icon {
    border-radius: 0.25rem;
    align-items: center;
    display: flex;
    font-size: 2rem;
    justify-content: center;
    width: 70px;
    flex-shrink: 0;
    margin-right: 0.75rem;
}

.info-box-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
}

.info-box-text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.info-box-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
}

/* === SMALL-BOX (AdminLTE 4) === */
.small-box {
    border-radius: 0.25rem;
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.2);
    display: block;
    margin-bottom: 1.25rem;
    position: relative;
}

.small-box > .inner {
    padding: 0.75rem;
}

.small-box > .inner h3 {
    font-size: 2.2rem;
    font-weight: bold;
    margin: 0 0 0.625rem;
    padding: 0;
    white-space: nowrap;
}

.small-box > .inner p {
    font-size: 1rem;
    margin: 0;
}

.small-box > .small-box-footer {
    background-color: rgba(0, 0, 0, 0.1);
    color: rgba(255, 255, 255, 0.8);
    display: block;
    padding: 0.375rem 0.75rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.small-box > .small-box-footer:hover {
    background-color: rgba(0, 0, 0, 0.15);
    color: #fff;
}

.small-box .icon {
    font-size: 5rem;
    opacity: 0.15;
    position: absolute;
    right: 0.9375rem;
    top: 0.9375rem;
    transition: transform 0.3s ease;
}

.small-box:hover .icon {
    transform: scale(1.1);
}

/* === TIMELINE (AdminLTE 4) === */
.timeline {
    position: relative;
    margin: 0 0 30px;
    padding: 0;
    list-style: none;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #dee2e6;
    left: 31px;
    margin-left: -1.5px;
}

.timeline > li {
    position: relative;
    margin-right: 10px;
    margin-bottom: 15px;
}

.timeline > li::after,
.timeline > li::before {
    content: "";
    display: table;
}

.timeline > li::after {
    clear: both;
}

.timeline > li > .timeline-item {
    box-shadow: 0 0 1px rgba(0, 0, 0, 0.125), 0 1px 3px rgba(0, 0, 0, 0.2);
    border-radius: 0.25rem;
    background-color: #fff;
    color: #495057;
    margin-left: 60px;
    margin-right: 15px;
    margin-top: 0;
    padding: 15px;
    position: relative;
}

.timeline > li > .timeline-item > .time {
    color: #999;
    float: right;
    padding: 10px;
    font-size: 12px;
}

.timeline > li > .timeline-item > .timeline-header {
    margin: 0;
    color: #495057;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    padding-bottom: 10px;
    font-size: 16px;
    line-height: 1.1;
}

.timeline > li > .timeline-item > .timeline-body,
.timeline > li > .timeline-item > .timeline-footer {
    padding-top: 10px;
}

.timeline > li > .time-label > span {
    font-weight: 600;
    padding: 5px;
    display: inline-block;
    background-color: #fff;
    border-radius: 4px;
}

/* === COULEURS ADMINLTE 2 === */
.bg-aqua, .bg-light-blue { background-color: #17a2b8 !important; color: #fff !important; }
.bg-red { background-color: #dc3545 !important; color: #fff !important; }
.bg-yellow { background-color: #ffc107 !important; color: #212529 !important; }
.bg-green { background-color: #28a745 !important; color: #fff !important; }
.bg-blue { background-color: #007bff !important; color: #fff !important; }
.bg-navy { background-color: #001f3f !important; color: #fff !important; }
.bg-teal { background-color: #20c997 !important; color: #fff !important; }
.bg-olive { background-color: #3d9970 !important; color: #fff !important; }
.bg-lime { background-color: #01ff70 !important; color: #212529 !important; }
.bg-orange { background-color: #fd7e14 !important; color: #fff !important; }
.bg-fuchsia { background-color: #f012be !important; color: #fff !important; }
.bg-purple { background-color: #6f42c1 !important; color: #fff !important; }
.bg-maroon { background-color: #d81b60 !important; color: #fff !important; }
.bg-black { background-color: #000 !important; color: #fff !important; }
.bg-gray { background-color: #6c757d !important; color: #fff !important; }

/* === ANIMATIONS === */
@keyframes fa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spinner-border {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spin,
i.fa-spin,
span.fa-spin,
.fas.fa-spin,
.fa-spinner,
.fas.fa-spinner,
i.fa-spinner,
span.fa-spinner,
.fa-circle-notch,
.fas.fa-circle-notch,
i.fa-circle-notch,
span.fa-circle-notch,
.fa-sync,
.fa-sync-alt,
i[class*="fa-spinner"],
i[class*="fa-circle-notch"],
span[class*="fa-spinner"],
span[class*="fa-circle-notch"],
.modal-ajax-loader,
.modal-ajax-loader * {
    animation: fa-spin 1s infinite linear !important;
    display: inline-block !important;
}

.spinner-border,
.spinner-grow {
    animation: spinner-border 0.75s linear infinite !important;
}

/* === RESPONSIVE === */
@media (max-width: 767px) {
    .sidebar-brand .brand-text {
        display: none;
    }
}

/* === OVERRIDES SIDEBAR === */
.app-sidebar,
.app-sidebar *,
.sidebar-wrapper,
.sidebar-wrapper * {
    font-size: 1rem !important;
}
