/***************************************************
 * DMX EXTRANET 3 — THEME PRINCIPAL
 ***************************************************/

/* ================================
   COULEURS & VARIABLES GLOBAL
================================ */
body {
    background: var(--body-bg);
    color: var(--body-text);
    font-family: "Segoe UI", Roboto, Arial, sans-serif;
}

.dmx-content {
    margin-left: var(--sidebar-width);
    margin-top: var(--topbar-height);
    padding: 20px;
}

/***************************************************
 * SIDEBAR
 ***************************************************/
.dmx-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid #1e1e1f;
    z-index: 1000;
    overflow-y: auto;
    transition: all .25s ease;
}

/* LOGOS SIDEBAR */
.dmx-sidebar-logo {
    padding: 12px 0;
    text-align: center;
}

.dmx-logo-sidebar {
    height: auto;
}

/* LOGO FULL (sidebar ouverte) */
.dmx-logo-full {
    max-width: 180px;
    display: block !important;
    margin: 0 auto;
}

/* LOGO SMALL (sidebar fermée) */
.dmx-logo-small {
    max-width: 40px;
    display: none !important;
    margin: 0 auto;
}

/* Quand la sidebar est COLLAPSÉE : inversion */
.dmx-sidebar.collapsed .dmx-logo-full {
    display: none !important;
}

.dmx-sidebar.collapsed .dmx-logo-small {
    display: block !important;
}

/***************************************************
 * MENU SIDEBAR
 ***************************************************/
.dmx-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.dmx-menu li a {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: .15s;
}

.dmx-menu li a:hover {
    background: #202024;
    color: #fff;
}

.dmx-menu li a.active {
    background: var(--dmx-purple-dark);
    color: #fff;
    border-left-color: var(--dmx-purple);
}

.dmx-menu i {
    width: 20px;
}

/***************************************************
 * TOPBAR
 ***************************************************/
.dmx-topbar {
    position: fixed;
    left: var(--sidebar-width);
    right: 0;
    top: 0;
    height: var(--topbar-height);
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 900;
}

.dmx-topbar-left {
    display: flex;
    align-items: center;
    gap: .75rem;
    font-weight: 600;
    color: var(--dmx-purple-dark);
}

.dmx-logo-topbar {
    height: 32px;
    width: auto;
}

.dmx-topbar-right {
    display: flex;
    align-items: center;
    gap: .75rem;
}

/***************************************************
 * BOUTONS
 ***************************************************/
.btn-dmx {
    background: var(--dmx-purple);
    border-color: var(--dmx-purple);
    color: #fff;
}

.btn-dmx:hover {
    background: var(--dmx-purple-dark);
    border-color: var(--dmx-purple-dark);
}

/***************************************************
 * SIDEBAR COLLAPSÉE
 ***************************************************/
.dmx-sidebar.collapsed {
    width: var(--sidebar-width-collapsed);
}

.dmx-sidebar.collapsed ~ .dmx-topbar {
    left: var(--sidebar-width-collapsed);
}

.dmx-sidebar.collapsed ~ .dmx-content {
    margin-left: var(--sidebar-width-collapsed);
}

/***************************************************
 * DATATABLES / FORMS / GENERAL
 ***************************************************/
table.dataTable thead th {
    background: var(--dmx-purple);
    color: #fff;
    border-color: var(--dmx-purple-dark);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--dmx-purple-dark) !important;
    color: #fff !important;
}

.form-control:focus {
    border-color: var(--dmx-purple);
    box-shadow: 0 0 0 .15rem rgba(130, 53, 140, .25);
}

/***************************************************
 * GLOBAL LOADER
 ***************************************************/
#dmx-global-loader {
    position: fixed;
    inset: 0;
    background: rgba(255,255,255,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

#dmx-global-loader img {
    width: 120px;
    height: auto;
}
