:root {
  --main-bg-color: #f8f9fa;
  --sidebar-bg-color: #1e293b;
  --sidebar-text-color: #94a3b8; /* Gris moyen pour le texte inactif */
  --second-bg-color: #ffffff;
  --accent-color: #0f172a;
  --accent-hover: #334155;
  --primary-brand: #2563eb;
  --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --text-color: #334155;
  --heading-color: #0f172a;

  /* Dashboard Stat Colors */
  --stat-blue-bg: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --stat-green-bg: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --stat-orange-bg: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --stat-purple-bg: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
  --stat-cyan-bg: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --stat-dark-bg: linear-gradient(135deg, #334155 0%, #1e293b 100%);
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--main-bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Sidebar & Layout */
#wrapper {
    overflow-x: hidden;
}

#sidebar-wrapper {
    min-height: 100vh;
    margin-left: -17rem;
    transition: margin 0.25s ease-out;
    background-color: var(--sidebar-bg-color);
    width: 17rem;
    box-shadow: 4px 0 24px rgba(0,0,0,0.05);
}

#sidebar-wrapper .sidebar-heading {
    padding: 2rem 1.5rem;
    font-size: 1.25rem;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: transparent;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

#sidebar-wrapper .list-group {
    width: 17rem;
    padding: 0 1rem;
}

#page-content-wrapper {
    min-width: 100vw;
    transition: margin 0.25s ease-out;
}

#wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
}

/* Sidebar Links */
.list-group-item {
    border: none;
    padding: 12px 16px;
    font-weight: 500;
    transition: all 0.2s;
    color: var(--sidebar-text-color);
    margin-bottom: 8px;
    border-radius: 6px;
    font-size: 0.95rem;
    background-color: rgba(255, 255, 255, 0.03); /* Légèrement visible pour les inactifs */
}

.list-group-item:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.list-group-item.active {
    background-color: var(--primary-brand);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px -2px rgba(37, 99, 235, 0.3);
}

.list-group-item i {
    width: 24px;
    text-align: center;
    margin-right: 12px;
    opacity: 0.8;
}

.list-group-item.active i {
    opacity: 1;
}

.sidebar-subheading {
    color: #64748b;
    font-size: 0.75rem;
    letter-spacing: 1.2px;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    text-transform: uppercase;
    font-weight: 700;
}

/* Déconnexion button specific style */
.list-group-item.text-danger {
    background-color: #ffffff;
    color: #ef4444 !important;
    margin-top: 3rem;
    text-align: center;
    font-weight: 700;
}
.list-group-item.text-danger:hover {
    background-color: #fef2f2;
    transform: none;
}
.list-group-item.text-danger i {
    color: #ef4444;
}

/* Navbar */
.navbar {
    background-color: #ffffff !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 1rem 2rem !important;
    border-bottom: 1px solid #e2e8f0;
}

.navbar-toggler {
    border: none;
    color: var(--heading-color);
}
.navbar-toggler:focus {
    box-shadow: none;
}
.primary-text {
    color: var(--primary-brand);
}

#menu-toggle {
    cursor: pointer;
    color: var(--heading-color);
}

h2 {
    color: var(--heading-color);
    font-weight: 700 !important;
    font-size: 1.5rem !important;
}

/* Cards (Professional) */
.card {
    background: var(--second-bg-color);
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: var(--card-shadow);
    color: var(--text-color);
    margin-bottom: 24px;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
    padding: 1rem 1.5rem;
    color: var(--heading-color);
}

.card-body {
    padding: 1.5rem;
}

/* Stat Cards */
.stat-card {
    border-radius: 12px;
    padding: 1.5rem;
    color: white;
    position: relative;
    overflow: hidden;
    height: 100%;
    transition: transform 0.2s;
    border: none !important;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.stat-card .stat-label {
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0;
}

.stat-card .stat-icon {
    position: absolute;
    bottom: -10px;
    right: -10px;
    font-size: 4rem;
    opacity: 0.15;
    transform: rotate(-15deg);
}

.stat-card-blue { background: var(--stat-blue-bg); }
.stat-card-green { background: var(--stat-green-bg); }
.stat-card-orange { background: var(--stat-orange-bg); }
.stat-card-purple { background: var(--stat-purple-bg); }
.stat-card-cyan { background: var(--stat-cyan-bg); }
.stat-card-dark { background: var(--stat-dark-bg); }

/* Tables */
.table {
    color: var(--text-color);
    margin-bottom: 0;
}
.table thead th {
    color: #475569;
    background-color: #f1f5f9;
    border-bottom: 2px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    font-weight: 700;
    padding: 1rem;
}
.table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Forms */
.form-control, .form-select {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--heading-color);
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 0.95rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-brand);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    color: #475569;
    font-weight: 600;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.input-group-text {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    color: #64748b;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-brand);
    border-color: var(--primary-brand);
    border-radius: 6px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: #1d4ed8;
    border-color: #1d4ed8;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

.btn-outline-primary {
    color: var(--primary-brand);
    border-color: var(--primary-brand);
    border-radius: 6px;
    font-weight: 600;
}
.btn-outline-primary:hover {
    background-color: var(--primary-brand);
    color: white;
}

.btn-danger {
    background-color: #ef4444;
    border: none;
    border-radius: 6px;
    font-weight: 600;
}

/* Login Page */
.login-wrapper {
    min-height: 100vh;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-wrapper .card {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

/* Utilities */
.text-primary-brand {
    color: var(--primary-brand) !important;
}
.bg-primary-brand {
    background-color: var(--primary-brand) !important;
}
.text-muted {
    color: #94a3b8 !important;
}
.fw-bold {
    font-weight: 700 !important;
}

/* Responsive */
@media (min-width: 768px) {
    #sidebar-wrapper {
        margin-left: 0;
    }

    #page-content-wrapper {
        min-width: 0;
        width: 100%;
    }

    #wrapper.toggled #sidebar-wrapper {
        margin-left: -17rem;
    }
}
