/**
 * WEEGOSOFT MANAGER (WSM) - Design System Central Stylesheet
 * Standardise Bootstrap 4.3.1 - FontAwesome 5.10.2 - Multi-Theme Aware
 */

/* 1. FLEXBOX GAP HELPERS (Bootstrap 4.3.1 Compatibility) */
.wsm-gap-0  { gap: 0 !important; }
.wsm-gap-1  { gap: 4px !important; }
.wsm-gap-2  { gap: 8px !important; }
.wsm-gap-3  { gap: 12px !important; }
.wsm-gap-4  { gap: 16px !important; }
.wsm-gap-5  { gap: 24px !important; }
.wsm-gap-6  { gap: 32px !important; }

.wsm-gap-x-1 { column-gap: 4px !important; }
.wsm-gap-x-2 { column-gap: 8px !important; }
.wsm-gap-x-3 { column-gap: 12px !important; }
.wsm-gap-x-4 { column-gap: 16px !important; }
.wsm-gap-x-5 { column-gap: 24px !important; }

.wsm-gap-y-1 { row-gap: 4px !important; }
.wsm-gap-y-2 { row-gap: 8px !important; }
.wsm-gap-y-3 { row-gap: 12px !important; }
.wsm-gap-y-4 { row-gap: 16px !important; }
.wsm-gap-y-5 { row-gap: 24px !important; }

/* 2. TOKEN-BASED SURFACE & ACCENT UTILITIES */
.wsm-text-primary {
    color: var(--primary) !important;
}

/* Amélioration du contraste de text-warning sur fond clair (WCAG AA : ratio > 4.5:1 sur blanc) */
.text-warning {
    color: #b45309 !important; /* Ambre foncé contrasté au lieu de #ffc107 invisible */
}

body.dark-mode .text-warning,
.theme-dark .text-warning {
    color: #fbbf24 !important; /* Ambre doré lumineux sur fond sombre */
}

.wsm-bg-primary-subtle {
    background-color: rgba(var(--primary-rgb, 40, 167, 69), 0.12) !important;
}

.wsm-border-primary-subtle {
    border-color: rgba(var(--primary-rgb, 40, 167, 69), 0.25) !important;
}

.wsm-card-surface {
    background-color: var(--card-bg, #ffffff) !important;
    color: var(--body-color, #212529);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.dark-mode .wsm-card-surface {
    background-color: var(--card-bg, #242738) !important;
    border-color: rgba(255, 255, 255, 0.06);
}

/* 3. BORDER RADIUS TOKENS */
.wsm-rounded-sm   { border-radius: 6px !important; }
.wsm-rounded      { border-radius: 8px !important; }
.wsm-rounded-lg   { border-radius: 12px !important; }
.wsm-rounded-xl   { border-radius: 16px !important; }
.wsm-rounded-pill { border-radius: 50rem !important; }

/* 4. SETTINGS & ENTITY CARDS (.settings-*) */
.settings-pg-wrap {
    padding-bottom: 70px;
}

.settings-card {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

body.dark-mode .settings-card {
    background: var(--card-bg, #242738);
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.settings-section-header {
    padding: 12px 18px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted, #6c757d);
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

body.dark-mode .settings-section-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.settings-list {
    margin-bottom: 0;
}

.settings-item {
    background: transparent;
    padding: 0;
    transition: background 0.15s ease-in-out;
}

.settings-item:hover {
    background: rgba(var(--primary-rgb, 40, 167, 69), 0.04);
}

.settings-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    color: inherit;
    text-decoration: none !important;
}

.settings-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(var(--primary-rgb, 40, 167, 69), 0.1);
    color: var(--primary);
    font-size: 15px;
    flex-shrink: 0;
}

.settings-label {
    font-size: 14.5px;
    font-weight: 600;
    color: var(--body-color, #212529);
    line-height: 1.3;
}

body.dark-mode .settings-label {
    color: #f1f5f9;
}

.settings-desc {
    font-size: 12.5px;
    color: var(--text-muted, #6c757d);
    margin-top: 2px;
}

/* 5. STATUS INDICATORS & METRIC SUMMARY BOXES */
.wsm-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.wsm-status-dot.online,
.wsm-status-dot.success { background-color: #28a745; box-shadow: 0 0 6px rgba(40, 167, 69, 0.6); }
.wsm-status-dot.warning { background-color: #ffc107; box-shadow: 0 0 6px rgba(255, 193, 7, 0.6); }
.wsm-status-dot.danger  { background-color: #dc3545; box-shadow: 0 0 6px rgba(220, 53, 69, 0.6); }
.wsm-status-dot.info    { background-color: #17a2b8; box-shadow: 0 0 6px rgba(23, 162, 184, 0.6); }

/* Quick Action Circle Button */
.wsm-quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none !important;
    padding: 12px 8px;
    border-radius: 12px;
    transition: all 0.2s ease;
    color: var(--body-color, #333);
}

.wsm-quick-action-btn:hover {
    background: rgba(var(--primary-rgb, 40, 167, 69), 0.08);
    transform: translateY(-2px);
}

.wsm-quick-action-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(var(--primary-rgb, 40, 167, 69), 0.12);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 8px;
    transition: all 0.2s ease;
}

.wsm-quick-action-btn:hover .wsm-quick-action-icon {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb, 40, 167, 69), 0.35);
}

.wsm-quick-action-label {
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.2;
}

/* ==========================================================================
   6. ICON BUTTONS (.btn.btn-icon)
   Boutons circulaires compacts pour actions de tableaux, pagination et outils
   ========================================================================== */
.btn.btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    line-height: 1 !important;
    flex-shrink: 0 !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn.btn-icon:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.btn.btn-icon.btn-sm {
    width: 32px !important;
    height: 32px !important;
    font-size: 13px !important;
}

.btn.btn-icon.btn-lg {
    width: 48px !important;
    height: 48px !important;
    font-size: 19px !important;
}

body.dark-mode .btn.btn-icon:not(.btn-primary):not(.btn-danger):not(.btn-success):not(.btn-info):not(.btn-warning):not(.btn-outline-primary) {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #e2e8f0 !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

/* ==========================================================================
   BANDEAU DE SYNTHÈSE INFÉRIEUR CANONIQUE WSM ($navbarBottom)
   ========================================================================== */
.wsm-navbar-bottom,
#wsm-navbar-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1030;
    background: var(--card-bg, #ffffff) !important;
    color: var(--text-main, #1e293b) !important;
    border-top: 2px solid var(--primary) !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Forcer l'adaptation des textes et séparateurs hérités dans le bandeau */
.wsm-navbar-bottom .text-white,
#wsm-navbar-bottom .text-white {
    color: var(--text-main, #1e293b) !important;
}

.wsm-navbar-bottom .text-white.opacity-50,
.wsm-navbar-bottom .text-white.opacity-75,
.wsm-navbar-bottom small.text-white,
#wsm-navbar-bottom .text-white.opacity-50,
#wsm-navbar-bottom .text-white.opacity-75,
#wsm-navbar-bottom small.text-white {
    color: var(--text-muted, #64748b) !important;
    opacity: 0.9 !important;
}

.wsm-navbar-bottom .border-secondary,
#wsm-navbar-bottom .border-secondary {
    border-color: var(--border-color, #e2e8f0) !important;
    opacity: 0.8 !important;
}

/* Forcer l'adaptation des textes d'avertissement/valeur dans le bandeau sur fond blanc */
.wsm-navbar-bottom .text-warning,
#wsm-navbar-bottom .text-warning {
    color: #b45309 !important; /* Ambre foncé accessible (WCAG AA > 4.5:1 sur blanc) */
}

.wsm-navbar-bottom .text-warning.opacity-75,
.wsm-navbar-bottom .text-warning.opacity-50,
.wsm-navbar-bottom small.text-warning,
#wsm-navbar-bottom .text-warning.opacity-75,
#wsm-navbar-bottom .text-warning.opacity-50,
#wsm-navbar-bottom small.text-warning {
    color: var(--text-muted, #64748b) !important;
    opacity: 1 !important;
}

/* Dark mode pour le bandeau */
body.dark-mode .wsm-navbar-bottom,
body.dark-mode #wsm-navbar-bottom,
.theme-dark .wsm-navbar-bottom,
.theme-dark #wsm-navbar-bottom {
    background: var(--card-bg, #1e293b) !important;
    color: #f1f5f9 !important;
    border-top: 2px solid var(--primary) !important;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

body.dark-mode .wsm-navbar-bottom .text-white,
body.dark-mode #wsm-navbar-bottom .text-white,
.theme-dark .wsm-navbar-bottom .text-white,
.theme-dark #wsm-navbar-bottom .text-white {
    color: #f1f5f9 !important;
}

body.dark-mode .wsm-navbar-bottom small.text-white,
body.dark-mode #wsm-navbar-bottom small.text-white,
.theme-dark .wsm-navbar-bottom small.text-white,
.theme-dark #wsm-navbar-bottom small.text-white {
    color: #94a3b8 !important;
}

body.dark-mode .wsm-navbar-bottom .text-warning,
body.dark-mode #wsm-navbar-bottom .text-warning,
.theme-dark .wsm-navbar-bottom .text-warning,
.theme-dark #wsm-navbar-bottom .text-warning {
    color: #fbbf24 !important; /* Ambre doré lumineux sur fond sombre */
}

body.dark-mode .wsm-navbar-bottom small.text-warning,
body.dark-mode #wsm-navbar-bottom small.text-warning,
.theme-dark .wsm-navbar-bottom small.text-warning,
.theme-dark #wsm-navbar-bottom small.text-warning {
    color: #94a3b8 !important;
}

/* 8. HARMONISATION CHECKBOXES & RADIOS SUR LA COULEUR PRIMARY DU THÈME */
.custom-control-input:checked ~ .custom-control-label::before,
.custom-checkbox .custom-control-input:checked ~ .custom-control-label::before,
.custom-radio .custom-control-input:checked ~ .custom-control-label::before {
    color: #fff !important;
    border-color: var(--primary) !important;
    background-color: var(--primary) !important;
}

.custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-rgb, 40, 167, 69), 0.25) !important;
}

.custom-control-input:focus:not(:checked) ~ .custom-control-label::before {
    border-color: var(--primary) !important;
}

.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-label::before {
    border-color: var(--primary) !important;
    background-color: var(--primary) !important;
}

input[type="checkbox"],
input[type="radio"] {
    accent-color: var(--primary) !important;
}



