/* ============================================================
   SCHOLA - DESIGN ULTRA PRO
   Thème : Orange (#F39C12), Bleu (#1A3A5C), Blanc (#FFFFFF)
   Version : 2.0 - Intégration dashboard.php
   ============================================================ */

/* ---------- VARIABLES ---------- */
:root {
    --primary-blue: #1a3a5c;
    --primary-blue-dark: #0a1628;
    --primary-blue-light: #2d6a9f;
    --primary-blue-gradient: linear-gradient(135deg, #0a1628 0%, #1a3a5c 50%, #2d6a9f 100%);
    --orange: #f39c12;
    --orange-light: #f1c40f;
    --orange-dark: #e67e22;
    --orange-gradient: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f3f5;
    --gray-200: #e9edf2;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #1e293b;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 30px 80px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ---------- BASE ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f2f5;
    color: var(--gray-900);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- SIDEBAR ---------- */
/* (Les styles du sidebar sont déjà dans la version précédente, nous les conservons) */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--primary-blue-gradient);
    color: #fff;
    overflow-y: auto;
    z-index: 1050;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateX(0);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.sidebar-header .brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: #fff;
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.sidebar-header .brand i {
    color: var(--orange);
    font-size: 2rem;
}
.sidebar-header .brand span {
    background: var(--orange-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.sidebar-header .brand .badge {
    font-size: 0.55rem;
    padding: 0.2rem 0.5rem;
    background: var(--orange);
    color: #fff;
    border-radius: 50px;
    -webkit-text-fill-color: #fff;
}
#closeSidebar {
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    transition: var(--transition);
}
#closeSidebar:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.sidebar-user {
    padding: 1.2rem 1.5rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 0.5rem;
    flex-shrink: 0;
}
.sidebar-user .avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--orange);
    flex-shrink: 0;
}
.sidebar-user .avatar i {
    font-size: 1.5rem;
    color: var(--orange);
}
.sidebar-user .user-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sidebar-user .user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sidebar-user .user-role {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.15rem 0.6rem;
    align-self: flex-start;
    border-radius: 50px;
    font-weight: 600;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0.5rem 1rem;
    overflow-y: auto;
}
.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav li {
    margin-bottom: 0.1rem;
}
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1.2rem;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    border-radius: 12px;
    position: relative;
}
.sidebar-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    transform: translateX(4px);
}
.sidebar-nav .nav-link.active {
    background: rgba(243, 156, 18, 0.2);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--orange);
}
.sidebar-nav .nav-link.active i {
    color: var(--orange);
}
.sidebar-nav .nav-link i {
    width: 1.5rem;
    text-align: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: var(--transition);
}
.sidebar-nav .nav-link span {
    white-space: nowrap;
}
.sidebar-nav .dropdown-toggle::after {
    margin-left: auto;
    transition: transform 0.3s;
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.6rem;
}
.sidebar-nav .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}
.sidebar-nav .collapse ul {
    padding-left: 2.5rem;
}
.sidebar-nav .collapse ul .nav-link {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}
.sidebar-nav .collapse ul .nav-link i {
    font-size: 0.85rem;
    width: 1.2rem;
}
.sidebar-nav .divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 0.5rem 1.5rem;
}
.sidebar-footer {
    padding: 0.8rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.65rem;
    flex-shrink: 0;
}

/* ---------- OVERLAY ---------- */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1049;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}
.sidebar-overlay.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ---------- MAIN CONTENT ---------- */
.main-content {
    margin-left: 280px;
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #f0f2f5;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---------- TOPBAR ---------- */
.topbar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0.6rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1030;
    min-height: 70px;
    flex-shrink: 0;
}
.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}
#toggleSidebar {
    display: none;
    color: var(--primary-blue);
    padding: 0;
    font-size: 1.5rem;
    border: none;
    background: none;
    transition: var(--transition);
}
#toggleSidebar:hover {
    transform: scale(1.1);
    color: var(--orange);
}
.page-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    letter-spacing: -0.3px;
}
.page-title i {
    color: var(--orange);
    margin-right: 0.5rem;
}
.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.topbar-right .notification-btn {
    position: relative;
    background: none;
    border: none;
    color: var(--gray-600);
    font-size: 1.2rem;
    padding: 0.4rem;
    border-radius: 50%;
    transition: var(--transition);
}
.topbar-right .notification-btn:hover {
    background: var(--gray-100);
    color: var(--orange);
}
.topbar-right .notification-btn .badge-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    border: 2px solid #fff;
}
.user-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 600;
    color: var(--gray-900);
    cursor: pointer;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    transition: var(--transition);
}
.user-info:hover {
    background: rgba(0, 0, 0, 0.04);
}
.user-info i {
    color: var(--orange);
    font-size: 1.5rem;
}
.user-info .user-name-top {
    font-weight: 600;
    font-size: 0.9rem;
}
.user-info .role-badge {
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.15rem 0.6rem;
    border-radius: 50px;
    font-weight: 600;
}

/* ---------- CONTENT WRAPPER ---------- */
.content-wrapper {
    padding: 2rem;
    flex: 1;
    animation: slideUp 0.4s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        width: 300px;
    }
    .sidebar.active {
        transform: translateX(0);
    }
    #closeSidebar {
        display: block;
    }
    #toggleSidebar {
        display: inline-block;
    }
    .main-content {
        margin-left: 0;
    }
    body.sidebar-open {
        overflow: hidden;
    }
    .content-wrapper {
        padding: 1.25rem;
    }
}
@media (max-width: 576px) {
    .sidebar {
        width: 100%;
    }
    .sidebar-header .brand {
        font-size: 1.4rem;
    }
    .topbar {
        padding: 0.5rem 0.8rem;
        min-height: 60px;
    }
    .topbar .page-title {
        font-size: 1rem;
    }
    .user-info .user-name-top {
        display: none;
    }
    .user-info .role-badge {
        display: none;
    }
    .content-wrapper {
        padding: 0.8rem;
    }
}

/* ============================================================
   DASHBOARD - STAT CARDS
   ============================================================ */
.stat-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.5rem 1rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 140px;
    display: flex;
    flex-direction: column;
}
.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    background: rgba(243, 156, 18, 0.1);
    color: var(--orange);
}
.stat-card .stat-content {
    flex: 1;
}
.stat-card .stat-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    font-weight: 600;
}
.stat-card .stat-number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0.2rem 0 0;
    line-height: 1.2;
}
.stat-card .stat-detail {
    font-size: 0.75rem;
    color: var(--gray-500);
}
.stat-card .stat-progress {
    height: 4px;
    background: var(--gray-100);
    border-radius: 4px;
    margin-top: 0.75rem;
    overflow: hidden;
}
.stat-card .stat-progress .progress-bar {
    height: 100%;
    border-radius: 4px;
    background: var(--orange-gradient);
    width: 0%;
    transition: width 1s ease;
}

/* Variantes de couleurs */
.stat-card-blue {
    background: linear-gradient(135deg, #0a1628 0%, #1a3a5c 100%);
    color: #fff;
}
.stat-card-blue .stat-icon {
    background: rgba(255, 255, 255, 0.15);
    color: var(--orange);
}
.stat-card-blue .stat-label {
    color: rgba(255, 255, 255, 0.6);
}
.stat-card-blue .stat-number {
    color: #fff;
}
.stat-card-blue .stat-progress .progress-bar {
    background: var(--orange-gradient);
}

.stat-card-orange {
    background: var(--orange-gradient);
    color: #fff;
}
.stat-card-orange .stat-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}
.stat-card-orange .stat-label {
    color: rgba(255, 255, 255, 0.7);
}
.stat-card-orange .stat-number {
    color: #fff;
}
.stat-card-orange .stat-progress .progress-bar {
    background: rgba(255, 255, 255, 0.5);
}

.stat-card-white {
    background: var(--white);
    color: var(--gray-900);
}
.stat-card-white .stat-icon {
    background: rgba(26, 58, 92, 0.1);
    color: var(--primary-blue);
}
.stat-card-white .stat-number {
    color: var(--primary-blue);
}
.stat-card-white .stat-progress .progress-bar {
    background: var(--primary-blue);
}

/* ============================================================
   DASHBOARD - CARTES STANDARD
   ============================================================ */
.card {
    border: none;
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: 1.5rem;
}
.card:hover {
    box-shadow: var(--shadow-md);
}
.card-header {
    background: var(--white);
    color: var(--gray-900);
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.card-header h5 {
    margin: 0;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.card-header h5 i {
    color: var(--orange);
}
.card-header .badge {
    font-size: 0.7rem;
}
.card-header .btn-outline-primary {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    padding: 0.2rem 1rem;
    font-size: 0.8rem;
}
.card-header .btn-outline-primary:hover {
    background: var(--primary-blue);
    color: #fff;
}
.card-body {
    padding: 1.5rem;
}
.card-footer {
    background: var(--gray-50);
    padding: 0.8rem 1.5rem;
    border-top: 1px solid var(--gray-100);
}

/* ============================================================
   DASHBOARD - ACTIVITY LIST
   ============================================================ */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.8rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    transition: var(--transition);
}
.activity-item:last-child {
    border-bottom: none;
}
.activity-item:hover {
    background: var(--gray-50);
}
.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    font-size: 0.9rem;
}
.activity-icon.bg-primary { background: var(--primary-blue); }
.activity-icon.bg-success { background: #2ecc71; }
.activity-icon.bg-info { background: #3498db; }
.activity-icon.bg-warning { background: var(--orange); }
.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.activity-text {
    font-size: 0.9rem;
    color: var(--gray-700);
}
.activity-text strong {
    color: var(--gray-900);
}
.activity-time {
    font-size: 0.7rem;
    color: var(--gray-500);
    margin-top: 0.1rem;
}

/* ============================================================
   DASHBOARD - CAROUSEL
   ============================================================ */
.carousel-card .carousel-slide-content {
    border-radius: var(--radius-md);
    padding: 2rem;
    min-height: 180px;
    display: flex;
    align-items: center;
}
.carousel-card .carousel-slide-content h3 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.carousel-card .carousel-slide-content p {
    opacity: 0.9;
    margin-bottom: 0.5rem;
}
.carousel-card .carousel-control-prev,
.carousel-card .carousel-control-next {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.8;
}
.carousel-card .carousel-control-prev:hover,
.carousel-card .carousel-control-next:hover {
    background: rgba(255, 255, 255, 0.4);
}
.carousel-card .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.5);
    background: transparent;
}
.carousel-card .carousel-indicators .active {
    background: var(--orange);
    border-color: var(--orange);
}

/* ============================================================
   DASHBOARD - CHILD CARD (Parent)
   ============================================================ */
.child-card {
    background: var(--gray-50);
    border-radius: var(--radius-md);
    padding: 1.2rem;
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--gray-200);
}
.child-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--orange);
}
.child-card .child-avatar {
    margin-bottom: 0.5rem;
}
.child-card .child-avatar i {
    color: var(--primary-blue);
}
.child-card .child-info h6 {
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.child-card .child-info small {
    display: block;
    margin-bottom: 0.5rem;
}

/* ============================================================
   DASHBOARD - PERFORMANCE CIRCLE (Élève)
   ============================================================ */
.performance-circle {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* ============================================================
   TABLEAUX GÉNÉRAUX
   ============================================================ */
.table-container {
    overflow-x: auto;
    border-radius: var(--radius-md);
}
.table {
    font-size: 0.9rem;
    margin-bottom: 0;
    width: 100%;
}
.table thead th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--gray-200);
    padding: 0.8rem 0.75rem;
    white-space: nowrap;
}
.table tbody td {
    padding: 0.8rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-800);
}
.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}
.table-hover > tbody > tr:hover {
    background-color: rgba(243, 156, 18, 0.05);
}
.table .badge-status {
    padding: 0.25rem 0.7rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* ============================================================
   BOUTONS
   ============================================================ */
.btn {
    border-radius: 50px;
    padding: 0.45rem 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.2px;
    transition: var(--transition);
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary {
    background: var(--primary-blue-gradient);
    color: #fff;
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 58, 92, 0.35);
    color: #fff;
}
.btn-orange {
    background: var(--orange-gradient);
    color: #fff;
}
.btn-orange:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.4);
    color: #fff;
}
.btn-success {
    background: linear-gradient(135deg, #0f7b3a, #2ecc71);
    color: #fff;
}
.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(46, 204, 113, 0.35);
    color: #fff;
}
.btn-danger {
    background: linear-gradient(135deg, #a93226, #e74c3c);
    color: #fff;
}
.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.35);
    color: #fff;
}
.btn-warning {
    background: var(--orange-gradient);
    color: #fff;
}
.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(243, 156, 18, 0.35);
    color: #fff;
}
.btn-outline-primary {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}
.btn-outline-primary:hover {
    background: var(--primary-blue);
    color: #fff;
    transform: translateY(-2px);
}
.btn-outline-orange {
    background: transparent;
    color: var(--orange);
    border: 2px solid var(--orange);
}
.btn-outline-orange:hover {
    background: var(--orange);
    color: #fff;
    transform: translateY(-2px);
}
.btn-sm {
    padding: 0.25rem 0.9rem;
    font-size: 0.8rem;
}
.btn-lg {
    padding: 0.6rem 2rem;
    font-size: 1rem;
}

/* ============================================================
   FORMULAIRES
   ============================================================ */
.form-control,
.form-select {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--white);
    color: var(--gray-900);
}
.form-control:focus,
.form-select:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(243, 156, 18, 0.15);
    outline: none;
}
.form-control::placeholder {
    color: var(--gray-400);
}
.form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--gray-700);
    margin-bottom: 0.3rem;
}
.form-text {
    color: var(--gray-500);
    font-size: 0.8rem;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.7rem;
    letter-spacing: 0.2px;
}
.badge-primary { background: var(--primary-blue); color: #fff; }
.badge-orange { background: var(--orange); color: #fff; }
.badge-success { background: #2ecc71; color: #fff; }
.badge-danger { background: #e74c3c; color: #fff; }
.badge-warning { background: #f1c40f; color: var(--gray-900); }
.badge-info { background: #3498db; color: #fff; }
.badge-secondary { background: var(--gray-500); color: #fff; }

/* ============================================================
   ALERTES
   ============================================================ */
.alert {
    border-radius: var(--radius-md);
    border: none;
    padding: 1rem 1.5rem;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    border-left: 4px solid;
}
.alert-success {
    background: #ecfdf5;
    color: #0f7b3a;
    border-left-color: #2ecc71;
}
.alert-danger {
    background: #fef2f2;
    color: #a93226;
    border-left-color: #e74c3c;
}
.alert-info {
    background: #eff6ff;
    color: var(--primary-blue);
    border-left-color: #3498db;
}
.alert-warning {
    background: #fffbeb;
    color: #b7950b;
    border-left-color: #f1c40f;
}
.alert .alert-icon {
    margin-right: 0.75rem;
    font-size: 1.2rem;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--gray-50);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--orange);
}

/* ============================================================
   SELECT2 OVERRIDE
   ============================================================ */
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--gray-200);
    padding: 0.2rem 0.5rem;
    min-height: 42px;
}
.select2-container--default .select2-selection--single:focus,
.select2-container--default .select2-selection--multiple:focus {
    border-color: var(--orange);
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 38px;
    color: var(--gray-900);
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(243, 156, 18, 0.15);
    border: 1px solid var(--orange);
    border-radius: 50px;
    padding: 0.1rem 0.6rem;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--orange);
}

/* ============================================================
   DATA TABLES OVERRIDE
   ============================================================ */
.dataTables_wrapper .dataTables_filter input {
    border-radius: 50px;
    padding: 0.4rem 1.2rem;
    border: 1.5px solid var(--gray-200);
    background: var(--white);
    transition: var(--transition);
    font-size: 0.9rem;
}
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 4px rgba(243, 156, 18, 0.1);
    outline: none;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 50px !important;
    padding: 0.3rem 1rem !important;
    margin: 0 0.2rem !important;
    border: 1px solid var(--gray-200) !important;
    background: var(--white) !important;
    color: var(--gray-700) !important;
    transition: var(--transition);
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-blue) !important;
    border-color: var(--primary-blue) !important;
    color: #fff !important;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--orange) !important;
    border-color: var(--orange) !important;
    color: #fff !important;
}

/* ============================================================
   UTILITAIRES
   ============================================================ */
.text-orange { color: var(--orange); }
.text-primary-blue { color: var(--primary-blue); }
.bg-orange { background: var(--orange); }
.bg-primary-blue { background: var(--primary-blue); }
.shadow-hover { transition: var(--transition); }
.shadow-hover:hover { box-shadow: var(--shadow-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-md { border-radius: var(--radius-md); }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

/* ============================================================
   ANIMATIONS COMPLÉMENTAIRES
   ============================================================ */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}
.animate-pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}
.slide-in-right {
    animation: slideInRight 0.4s ease;
}

/* ============================================================
   RESPONSIVE ADDITIONNEL (pour dashboard)
   ============================================================ */
@media (max-width: 768px) {
    .stat-card .stat-number {
        font-size: 1.8rem;
    }
    .stat-card {
        min-height: 120px;
        padding: 1rem;
    }
    .child-card {
        margin-bottom: 1rem;
    }
    .carousel-card .carousel-slide-content {
        padding: 1rem;
        min-height: 140px;
    }
    .carousel-card .carousel-slide-content h3 {
        font-size: 1.1rem;
    }
    .carousel-card .carousel-slide-content i {
        font-size: 40px !important;
    }
}
@media (max-width: 576px) {
    .stat-card .stat-number {
        font-size: 1.5rem;
    }
    .stat-card .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    .activity-item {
        padding: 0.6rem 1rem;
        flex-wrap: wrap;
    }
    .activity-icon {
        width: 30px;
        height: 30px;
        font-size: 0.7rem;
    }
    .activity-text {
        font-size: 0.8rem;
    }
}
/* Fix pour les graphiques (éviter le défilement infini) */
.chart-card .card-body {
    position: relative;
    height: 280px;
    max-height: 280px;
    overflow: hidden;
}

.chart-card .card-body canvas {
    max-height: 100%;
    max-width: 100%;
}

@media (max-width: 576px) {
    .chart-card .card-body {
        height: 220px;
        max-height: 220px;
    }
}