/* PASTEL SaaS UI Tokens */
:root {
    --p-primary: #6366f1; --p-primary-dark: #4f46e5; --p-accent: #8b5cf6;
    --p-success: #22c55e; --p-warning: #f59e0b; --p-danger: #ef4444;
    --p-surface: #fff; --p-border: #e2e8f0; --p-text: #1e293b; --p-muted: #64748b;
    --p-sidebar-bg: #ffffff;
}

/* Styled checkboxes */
input[type="checkbox"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #cbd5e1;
    border-radius: 0.375rem;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    flex-shrink: 0;
}
input[type="checkbox"]:hover {
    border-color: var(--p-primary);
}
input[type="checkbox"]:checked {
    background: var(--p-primary);
    border-color: var(--p-primary);
}
input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
input[type="checkbox"].sr-only {
    -webkit-appearance: none;
    appearance: none;
    width: 1px;
    height: 1px;
    border: 0;
    background: transparent;
}
input[type="checkbox"].sr-only:checked::after {
    display: none;
}

.dark input[type="checkbox"] {
    background: #1e293b;
    border-color: #475569;
}
.dark input[type="checkbox"]:checked {
    background: var(--p-primary);
    border-color: var(--p-primary);
}

.dark {
    --p-surface: #1e293b; --p-border: #334155; --p-text: #e2e8f0; --p-muted: #94a3b8;
    --p-sidebar-bg: #0f172a;
}
body { font-family: "Poppins", system-ui, sans-serif !important; }
.sidebar { width: 260px; min-height: 100vh; background: var(--p-sidebar-bg); border-right: 1px solid var(--p-border); position: fixed; top: 0; left: 0; z-index: 40; overflow-y: auto; transition: transform 0.3s ease; }
.sidebar-hidden { transform: translateX(-260px); }
.sidebar .nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 20px; font-size: 14px; color: #475569; border-radius: 8px; margin: 2px 12px; transition: all 0.15s; text-decoration: none; }
.sidebar .nav-link:hover { background: #f1f5f9; color: #1e293b; }
.sidebar .nav-link.active { background: #f1f5f9; color: #1e293b; }
.dark .sidebar .nav-link { color: #94a3b8; }
.dark .sidebar .nav-link:hover { background: #1e293b; color: #e2e8f0; }
.dark .sidebar .nav-link.active { background: #1e293b; color: #e2e8f0; }
.sidebar .nav-link i, .sidebar .nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: #94a3b8; padding: 16px 20px 6px; }
.top-navbar { height: 64px; background: var(--p-surface); border-bottom: 1px solid var(--p-border); position: fixed; top: 0; right: 0; left: 260px; z-index: 30; display: flex; align-items: center; padding: 0 24px; transition: left 0.3s ease; }
.top-navbar.full-width { left: 0; }
.main-content { margin-left: 260px; padding-top: 64px; min-height: 100vh; transition: margin-left 0.3s ease; }
.main-content.full-width { margin-left: 0; }
.main-inner { padding: 24px; max-width: 1400px; margin: 0 auto; }
.card-p { background: var(--p-surface); border: 1px solid var(--p-border); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.card-p .card-p-header { margin: -20px -20px 16px -20px; padding: 14px 20px; border-radius: 12px 12px 0 0; }
.card-p:hover { box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.border-l-synthese { border-left: 4px solid #22c55e; }
.border-l-notes { border-left: 4px solid #f59e0b; }
.border-l-examen { border-left: 4px solid #ef4444; }
.border-l-exercices { border-left: 4px solid #06b6d4; }
.border-l-autre { border-left: 4px solid #6366f1; }
.bg-type-synthese { background: #dcfce7; color: #15803d; }
.bg-type-notes { background: #fef3c7; color: #b45309; }
.bg-type-examen { background: #fee2e2; color: #b91c1c; }
.bg-type-exercices { background: #cffafe; color: #0e7490; }
.bg-type-autre { background: #e0e7ff; color: #4338ca; }
.lesson-document { border-bottom: 3px solid #6366f1; color: #6366f1; }
.lesson-link { border-bottom: 3px solid #a78bfa; color: #a78bfa; }
.lesson-quiz { border-bottom: 3px solid #06b6d4; color: #06b6d4; }
.lesson-stats { height: 28px; font-size: 13px; padding-top: 4px; }
#file-area { margin-top: 15px; width: 100%; height: 180px; border: 2px dashed var(--p-border); border-radius: 12px; background: #f8fafc; position: relative; display: table; transition: all 0.2s; }
#file-area:hover { border-color: var(--p-primary); background: #eef2ff; }
.file-area-success { border-color: var(--p-success) !important; background: #f0fdf4 !important; }
.file-area-wrong { border-color: var(--p-danger) !important; background: #fef2f2 !important; }
.file-dummy { text-align: center; display: table-cell; vertical-align: middle; }
#file-area input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.notification-box { padding: 16px; border-radius: 10px; margin-bottom: 8px; background: #f8fafc; border: 1px solid var(--p-border); transition: all 0.15s; }
.notification-box:hover { background: #f1f5f9; }
.dark .notification-box { background: #1e293b; }
.dark .notification-box:hover { background: #0f172a; }
.badge-vote { position: absolute; top: 0; right: 20px; width: 50px; text-align: center; font-weight: 700; }
.badge-vote.positive-vote { color: var(--p-success); border-top: 3px solid var(--p-success); }
.badge-vote.negative-vote { color: var(--p-danger); border-top: 3px solid var(--p-danger); }
.container-vote { position: fixed; left: 0; top: calc(50% - 80px); border-radius: 0 12px 12px 0; border: 1px solid var(--p-border); background: var(--p-surface); z-index: 20; }
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-260px); display: block !important; }
    .sidebar.open { transform: translateX(0); }
    .top-navbar { left: 0; }
    .main-content { margin-left: 0; padding-bottom: 72px; }
}

/* Mobile bottom navigation */
#mobile-bottom-nav { transition: transform 0.3s ease; }
.mobile-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex: 1; font-size: 10px; font-weight: 500; color: #94a3b8; text-decoration: none; transition: color 0.15s; padding: 4px 0; }
.mobile-nav-item.active { color: #6366f1; }
.mobile-nav-item:hover { color: #6366f1; }
.dark .mobile-nav-item { color: #64748b; }
.dark .mobile-nav-item.active { color: #818cf8; }
.dark .mobile-nav-item:hover { color: #818cf8; }

/* Avatar rank rings */
.avatar-ring-bronze { box-shadow: 0 0 0 2.5px #cd7f32; }
.avatar-ring-silver { box-shadow: 0 0 0 2.5px #c0c0c0; }
.avatar-ring-gold { box-shadow: 0 0 0 3px #ffd700, 0 0 8px rgba(255,215,0,0.4); }

/* ======================== */
/* MODAL SYSTEM             */
/* ======================== */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1050;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.modal.show { opacity: 1; }
.modal.fade { transition: opacity 0.2s ease; }

.pastel-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1040;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.pastel-modal-backdrop.show { opacity: 1; }

.modal-dialog {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    z-index: 1055;
    transform: translateY(-10px);
    transition: transform 0.2s ease;
}
.modal.show .modal-dialog { transform: translateY(0); }

.modal-dialog.modal-sm { max-width: 340px; }
.modal-dialog.modal-md { max-width: 500px; }
.modal-dialog.modal-lg { max-width: 800px; }
.modal-dialog.modal-xl { max-width: 1140px; }
.modal-dialog.modal-full-screen { max-width: 100%; max-height: 100vh; }
.modal-dialog.modal-dialog-centered { display: flex; flex-direction: column; justify-content: center; min-height: calc(100vh - 32px); }

.modal-content {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.dark .modal-content {
    background: #1e293b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}
.dark .modal-header { border-bottom-color: #334155; }
.modal-header .modal-title { font-size: 16px; font-weight: 700; color: #1e293b; margin: 0; }
.dark .modal-header .modal-title { color: #e2e8f0; }
.modal-header .close {
    background: none;
    border: none;
    font-size: 22px;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: all 0.15s;
}
.modal-header .close:hover { color: #475569; background: #f1f5f9; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.dark .modal-body { color: #cbd5e1; }
.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 20px;
    border-top: 1px solid #e2e8f0;
}
.dark .modal-footer { border-top-color: #334155; }

/* ======================== */
/* COLLAPSE SYSTEM          */
/* ======================== */
.collapse { display: none; }
.collapse.show { display: block; }

/* ======================== */
/* TAB SYSTEM (Bootstrap)   */
/* ======================== */
.tab-pane { display: none; }
.tab-pane.active, .tab-pane.show { display: block; }

.nav-tabs { display: flex; border-bottom: 1px solid #e2e8f0; gap: 0; }
.dark .nav-tabs { border-bottom-color: #334155; }
.nav-tabs .nav-item { list-style: none; }
.nav-tabs .nav-link {
    display: block;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    cursor: pointer;
}
.nav-tabs .nav-link:hover { color: #6366f1; }
.nav-tabs .nav-link.active { color: #6366f1; border-bottom-color: #6366f1; font-weight: 600; }
.dark .nav-tabs .nav-link { color: #94a3b8; }
.dark .nav-tabs .nav-link:hover { color: #818cf8; }
.dark .nav-tabs .nav-link.active { color: #818cf8; border-bottom-color: #818cf8; }

.nav.md-pills { display: flex; flex-direction: column; gap: 4px; }
.nav.md-pills .nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s;
    cursor: pointer;
}
.nav.md-pills .nav-link:hover { background: #f1f5f9; color: #1e293b; }
.nav.md-pills .nav-link.active { background: #6366f1; color: #fff; }
.dark .nav.md-pills .nav-link { color: #94a3b8; }
.dark .nav.md-pills .nav-link:hover { background: #1e293b; color: #e2e8f0; }

/* ======================== */
/* ACCORDION (FAQ compat)   */
/* ======================== */
.accordion .card { border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 6px; overflow: hidden; }
.accordion .card-header { background: #f8fafc; padding: 0; border-bottom: none; }
.dark .accordion .card { border-color: #334155; }
.dark .accordion .card-header { background: #1e293b; }
.accordion .card-header a {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #334155;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s;
}
.accordion .card-header a:hover { background: #f1f5f9; }
.accordion .card-body { padding: 12px 16px; font-size: 14px; color: #475569; line-height: 1.6; }
.dark .accordion .card-header a { color: #cbd5e1; }
.dark .accordion .card-header a:hover { background: #0f172a; }
.dark .accordion .card-body { color: #94a3b8; }
.accordion .rotate-icon { transition: transform 0.2s; float: right; margin-top: 2px; color: #94a3b8; }
.accordion .card-header a.active .rotate-icon,
.accordion .card-header a[aria-expanded="true"] .rotate-icon { transform: rotate(180deg); }

/* ======================== */
/* DROPDOWN (FAQ compat)    */
/* ======================== */
.btn-group { position: relative; }
.dropdown-menu {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    min-width: 200px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    padding: 6px;
    margin-bottom: 8px;
    z-index: 999;
}
.dark .dropdown-menu { background: #1e293b; border-color: #334155; box-shadow: 0 10px 25px rgba(0,0,0,0.4); }
.dropdown-item {
    display: block;
    width: 100%;
    padding: 8px 14px;
    font-size: 13px;
    color: #334155;
    text-decoration: none;
    border-radius: 8px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}
.dropdown-item:hover { background: #f1f5f9; color: #1e293b; }
.dark .dropdown-item { color: #cbd5e1; }
.dark .dropdown-item:hover { background: #0f172a; color: #e2e8f0; }

/* ======================== */
/* MISC BOOTSTRAP COMPAT    */
/* ======================== */
.btn-floating {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 47px;
    height: 47px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.15s;
}
.btn-floating.unique-color { background: #6366f1; color: #fff; }
.btn-floating.unique-color:hover { background: #4f46e5; }
.z-depth-2 { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }

/* ======================== */
/* MODERN SELECT            */
/* ======================== */
select,
.form-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding: 10px 36px 10px 14px;
    font-size: 14px;
    font-family: inherit;
    color: #1e293b;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    outline: none;
    cursor: pointer;
    transition: all 0.15s;
    width: 100%;
}
select:focus,
.form-select:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
select:hover,
.form-select:hover {
    border-color: #cbd5e1;
}
.dark select,
.dark .form-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
.dark select:focus, .dark .form-select:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
.dark select:hover, .dark .form-select:hover { border-color: #475569; }

/* ======================== */
/* MODERN FORM INPUTS       */
/* ======================== */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="tel"],
input[type="search"],
textarea,
.form-control {
    font-family: inherit;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    outline: none;
    transition: all 0.15s;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="tel"]:focus,
input[type="search"]:focus,
textarea:focus,
.form-control:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}
.dark input[type="text"],
.dark input[type="email"],
.dark input[type="password"],
.dark input[type="number"],
.dark input[type="url"],
.dark input[type="tel"],
.dark input[type="search"],
.dark textarea,
.dark .form-control {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}
.dark input[type="text"]:focus,
.dark input[type="email"]:focus,
.dark input[type="password"]:focus,
.dark input[type="number"]:focus,
.dark input[type="url"]:focus,
.dark input[type="tel"]:focus,
.dark input[type="search"]:focus,
.dark textarea:focus,
.dark .form-control:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}

/* ======================== */
/* MODERN BUTTONS           */
/* ======================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; font-size: 14px; font-weight: 600; border-radius: 10px; border: none; cursor: pointer; transition: all 0.15s; text-decoration: none; font-family: inherit; }
.btn:hover { transform: translateY(-1px); }
.btn-primary, .btn.btn-primary { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; box-shadow: 0 2px 8px rgba(99,102,241,0.25); }
.btn-primary:hover, .btn.btn-primary:hover { box-shadow: 0 4px 16px rgba(99,102,241,0.35); }
.btn-outline-primary { background: transparent; color: #6366f1; border: 1.5px solid #6366f1; }
.btn-outline-primary:hover { background: #eef2ff; }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-success { background: #22c55e; color: #fff; }
.btn-success:hover { background: #16a34a; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-rounded { border-radius: 9999px; }
.btn-link-secondary { background: transparent; color: #64748b; padding: 6px 12px; font-weight: 500; }
.btn-link-secondary:hover { color: #1e293b; background: #f1f5f9; }

/* ======================== */
/* STRETCHED LINK           */
/* ======================== */
.stretched-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* ======================== */
/* ANIMATION                */
/* ======================== */
@keyframes slide-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.animate-slide-in { animation: slide-in 0.3s ease-out; }

/* ======================== */
/* LEGACY COMPAT (Temp)     */
/* ======================== */
.md-form { margin-bottom: 16px; }
.md-form label { display: block; font-size: 13px; font-weight: 500; color: #64748b; margin-bottom: 4px; }
.md-form .md-textarea { min-height: 100px; resize: vertical; }
.white-text { color: #fff; }
.green-text { color: #22c55e; }
.red-text { color: #ef4444; }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; font-size: 12px; font-weight: 600; border-radius: 6px; }
.badge-primary { background: #e0e7ff; color: #4338ca; }
.badge-success, .badge-pill.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-light { background: #f1f5f9; color: #475569; }
.badge-pill { border-radius: 9999px; }
h2.h2-responsive { font-size: 1.5rem; font-weight: 700; color: #1e293b; }
h4.h4-responsive { font-size: 1.15rem; font-weight: 600; color: #1e293b; }
h6.h6-responsive { font-size: 0.95rem; font-weight: 600; color: #1e293b; }
.dark h2.h2-responsive, .dark h4.h4-responsive, .dark h6.h6-responsive { color: #e2e8f0; }
.row { display: flex; flex-wrap: wrap; margin: 0 -12px; }
.col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-8, .col-md-9 { padding: 0 12px; box-sizing: border-box; }
.col-md-3 { width: 25%; } .col-md-4 { width: 33.333%; } .col-md-5 { width: 41.667%; }
.col-md-6 { width: 50%; } .col-md-8 { width: 66.667%; } .col-md-9 { width: 75%; }
.col-xl-3 { width: 25%; } .col-lg-4 { width: 33.333%; } .col-lg-7 { width: 58.333%; }
.col-sm-5 { width: 41.667%; } .col-sm-6 { width: 50%; }
@media (max-width: 768px) { [class*="col-md-"], [class*="col-lg-"], [class*="col-xl-"], [class*="col-sm-"] { width: 100%; } }
.col-xs-12 { width: 100%; }
.p-3 { padding: 12px; }
.my-2 { margin-top: 8px; margin-bottom: 8px; }
.mt-3 { margin-top: 12px; }
.mx-2 { margin-left: 8px; margin-right: 8px; }
.mb-0 { margin-bottom: 0; }
hr { border: none; border-top: 1px solid #e2e8f0; margin: 16px 0; }
.d-none { display: none !important; }
.waves-effect { /* noop - removed MDB dependency */ }
.form-inline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ======================== */
/* TAB-BTN ACTIVE STATE     */
/* ======================== */
.tab-btn { cursor: pointer; border-bottom: 2px solid transparent; }
.tab-btn.active { color: #6366f1 !important; border-bottom: 2px solid #6366f1 !important; }
.tab-btn:not(.active) { color: #64748b; border-bottom-color: transparent; }
.tab-btn:not(.active):hover { color: #6366f1; }

/* ======================== */
/* TOGGLE COLLAPSE SYSTEM   */
/* ======================== */
[data-toggle="collapse"] .rotate-icon { transition: transform 0.3s ease; }
[data-toggle="collapse"][aria-expanded="true"] .rotate-icon,
[data-toggle="collapse"]:not(.collapsed) .rotate-icon { transform: rotate(180deg); }
.collapse { display: none; overflow: hidden; }
.collapse.show { display: block; }
.collapsing { height: 0; overflow: hidden; transition: height 0.3s ease; }

/* ======================== */
/* INLINE LUCIDE ICONS      */
/* ======================== */
[data-lucide], .lucide {
    display: inline-block;
    vertical-align: middle;
}

/* ======================== */
/* MODERN TOOLTIP           */
/* ======================== */
.pastel-tooltip {
    position: absolute;
    z-index: 99999;
    max-width: 260px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.4;
    color: #fff;
    background: #1e293b;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity .15s ease, transform .15s ease;
    white-space: normal;
    word-wrap: break-word;
}
.pastel-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}
.pastel-tooltip-arrow {
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 8px;
    height: 8px;
    background: #1e293b;
}
.pastel-tooltip.bottom .pastel-tooltip-arrow {
    bottom: auto;
    top: -4px;
}

/* ======================== */
/* TOGGLE SWITCH COLORS     */
/* ======================== */
.switch label input[type=checkbox]:checked + .lever { background-color: #c7d2fe; }
.switch label input[type=checkbox]:checked + .lever:after { background-color: #6366f1; }
input[type="checkbox"].sr-only:checked ~ div:first-of-type,
.peer:checked ~ .peer-checked\:bg-primary-500 { background-color: #6366f1 !important; }

/* ======================== */
/* BADGE STYLES (Global)    */
/* ======================== */
.badge { display: inline-flex; align-items: center; padding: 2px 8px; font-size: 11px; font-weight: 600; border-radius: 9999px; background: #f1f5f9; color: #475569; line-height: 1.5; }
.badge-primary { background: #e0e7ff; color: #4338ca; }
.badge-success, .badge-pill.badge-success { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-info { background: #e0f2fe; color: #0369a1; }
.badge-light { background: #f1f5f9; color: #475569; }
.badge-pill { border-radius: 9999px; }
.badge.orange, .badge.bg-orange, .badge[class*="orange"] { background: #fef3c7; color: #b45309; }

/* ======================== */
/* PROGRESS BARS (Modern)   */
/* ======================== */
.progress, .md-progress { background: #f1f5f9; border-radius: 9999px; overflow: hidden; }
.progress-bar { background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; border-radius: 9999px; transition: width 0.6s ease; }

/* ======================== */
/* FILTER ACTIVE STATE      */
/* ======================== */
.filter { cursor: pointer; }
.filter.btn-type-active#tout {
    background: #E0E7FF;
    color: #6770c5;
    border-color: #818cf8;
}

.filter.btn-type-active#synthese {
    background: #D1FAE5;
    color: #26976e;
    border-color: #34d399;
}

.filter.btn-type-active#notes {
    background: #FEF3C7;
    color: #BE5309;
    border-color: #fbbf24;
}

.filter.btn-type-active#examentype {
    background: #FEE2E2;
    color: #B91C3C;
    border-color: #f87171;
}

.filter.btn-type-active#exercices {
    background: #CFFAFE;
    color: #1894a7;
    border-color: #22d3ee;
}

.filter.btn-type-active#autre {
    background: #E0E7FF;
    color: #5e67b4;
    border-color: #818cf8;
}

/* ======================== */
/* FILE AREA (Modern)       */
/* ======================== */
#file-area, [id^="file-area"] { margin-top: 15px; width: 100%; min-height: 180px; border: 2px dashed #cbd5e1; border-radius: 16px; background: #f8fafc; position: relative; display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
#file-area:hover, [id^="file-area"]:hover { border-color: #6366f1; background: #eef2ff; }
.dark #file-area, .dark [id^="file-area"] { background: #0f172a; border-color: #475569; }
.dark #file-area:hover, .dark [id^="file-area"]:hover { border-color: #818cf8; background: #1e1b4b; }
.file-area-success { border-color: #22c55e !important; background: #f0fdf4 !important; }
.file-area-wrong { border-color: #ef4444 !important; background: #fef2f2 !important; }
.file-dummy { text-align: center; padding: 24px; }
#file-area input[type="file"], [id^="file-area"] input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ======================== */
/* SEARCH ICON RIGHT        */
/* ======================== */
.search-right { padding-left: 14px !important; padding-right: 36px !important; }
.search-right + .search-icon-right, .search-icon-right { left: auto !important; right: 12px !important; }

/* ======================== */
/* FORM FIELD STANDARD      */
/* Tous les champs ont bg blanc par défaut */
/* ======================== */
.form-input {
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.dark .form-input { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.form-input:focus {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
}
.form-input.is-invalid, .form-input.error {
    border-color: #ef4444;
}

/* ======================== */
/* CHOICES.JS override      */
/* ======================== */
.pastel-choices.choices {
    margin-bottom: 0;
    font-size: 14px;
    font-family: inherit;
}
.pastel-choices .choices__inner {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 6px 14px;
    min-height: 42px;
    font-size: 14px;
    display: flex;
    align-items: center;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.dark .pastel-choices .choices__inner { background: #0f172a; border-color: #334155; color: #e2e8f0; }
.dark .pastel-choices .choices__list--single .choices__item { color: #e2e8f0; }
.dark .pastel-choices .choices__list--dropdown { background: #1e293b; border-color: #334155; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.dark .pastel-choices .choices__list--dropdown .choices__item--selectable.is-highlighted { background: #312e81; color: #c4b5fd; }
.pastel-choices.is-open .choices__inner,
.pastel-choices .choices__inner:focus-within {
    border-color: #818cf8;
    box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15);
    outline: none;
}
.pastel-choices .choices__list--dropdown {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    overflow: hidden;
    z-index: 100;
}
.pastel-choices .choices__list--dropdown .choices__item--selectable.is-highlighted {
    background: #eef2ff;
    color: #4f46e5;
}
.pastel-choices .choices__list--single .choices__item {
    padding: 0;
    font-size: 14px;
    color: #1e293b;
}
.pastel-choices .choices__placeholder {
    color: #94a3b8;
    opacity: 1;
}
.pastel-choices[data-type*='select-one']::after {
    border-color: #94a3b8 transparent transparent transparent;
    right: 14px;
}
.pastel-choices.is-open[data-type*='select-one']::after {
    border-color: transparent transparent #6366f1 transparent;
}

/* ======================== */
/* DARK MODE OVERRIDES      */
/* ======================== */
.dark hr { border-top-color: #334155; }
.dark .sidebar-section { color: #64748b; }
.dark .md-form label { color: #94a3b8; }
.dark .card-p { background: #1e293b; border-color: #334155; }
.dark .card-p:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.3); }
.dark .progress, .dark .md-progress { background: #334155; }
.dark .badge-light { background: #334155; color: #94a3b8; }
.dark .white-text { color: #fff; }
.dark .green-text { color: #4ade80; }
.dark .red-text { color: #f87171; }
.dark .text-dark { color: #e2e8f0 !important; }
.dark .tab-btn:not(.active) { color: #94a3b8; }
.dark .tab-btn.active { color: #818cf8 !important; border-bottom-color: #818cf8 !important; }
.dark a { color: inherit; }
.dark .swiper-pagination-progressbar-fill { background: #818cf8 !important; }

/* FAQ details in dark mode */
.dark details.group { background: #0f172a; border-color: #334155; }
.dark details.group summary { color: #e2e8f0; }
.dark details.group summary:hover { background: #1e293b; }
.dark details.group div { color: #94a3b8; }
.dark .faq-tab-btn { color: #94a3b8; }
.dark .faq-tab-btn:hover { background: #1e293b; }
.dark .faq-tab-btn[style*="bg-primary"] { color: #818cf8; }
.dark .faq-tab-panel h5 { color: #e2e8f0; }
.dark .swiper-pagination-progressbar { background: #334155 !important; }

/* Common view-level dark overrides for repeated Tailwind patterns */
/* Question cards, info cards, stat cards */
.dark .question .card,
.dark .question.shadow-none { background: transparent; }

/* Colored feedback blocks — use ~= to avoid matching hover: prefixed classes */
.dark [class~="bg-emerald-50"] { background: rgba(6, 78, 59, 0.3) !important; }
.dark [class~="bg-red-50"] { background: rgba(127, 29, 29, 0.3) !important; }
.dark [class~="bg-amber-50"] { background: rgba(120, 53, 15, 0.3) !important; }
.dark [class~="bg-sky-50"] { background: rgba(12, 74, 110, 0.3) !important; }
.dark [class~="bg-cyan-50"] { background: rgba(22, 78, 99, 0.3) !important; }
.dark [class~="bg-primary-50"] { background: rgba(49, 46, 129, 0.3) !important; }
.dark [class~="bg-slate-50"]:not(body):not(.main-content) { background: #0f172a; }

/* Colored text softening for dark mode */
.dark [class~="text-emerald-700"] { color: #6ee7b7 !important; }
.dark [class~="text-red-700"] { color: #fca5a5 !important; }
.dark [class~="text-amber-700"] { color: #fcd34d !important; }
.dark [class~="text-sky-700"] { color: #7dd3fc !important; }
.dark [class~="text-cyan-700"] { color: #67e8f9 !important; }
.dark [class~="text-violet-700"] { color: #c4b5fd !important; }
.dark [class~="text-primary-700"] { color: #a5b4fc !important; }

/* Colored borders softening */
.dark [class~="border-emerald-200"] { border-color: rgba(6, 95, 70, 0.6) !important; }
.dark [class~="border-red-200"] { border-color: rgba(153, 27, 27, 0.6) !important; }
.dark [class~="border-amber-200"] { border-color: rgba(146, 64, 14, 0.6) !important; }
.dark [class~="border-sky-200"] { border-color: rgba(7, 89, 133, 0.6) !important; }
.dark [class~="border-cyan-200"] { border-color: rgba(21, 94, 117, 0.6) !important; }

/* Colored light backgrounds for badges/chips in dark mode */
.dark [class~="bg-emerald-100"] { background: rgba(6, 78, 59, 0.4) !important; }
.dark [class~="bg-red-100"] { background: rgba(127, 29, 29, 0.4) !important; }
.dark [class~="bg-amber-100"] { background: rgba(120, 53, 15, 0.4) !important; }
.dark [class~="bg-sky-100"] { background: rgba(12, 74, 110, 0.4) !important; }
.dark [class~="bg-cyan-100"] { background: rgba(22, 78, 99, 0.4) !important; }
.dark [class~="bg-primary-100"] { background: rgba(49, 46, 129, 0.4) !important; }
.dark [class~="bg-violet-100"] { background: rgba(76, 29, 149, 0.4) !important; }
.dark [class~="bg-rose-100"] { background: rgba(136, 19, 55, 0.4) !important; }
.dark [class~="bg-slate-100"]:not(body) { background: #1e293b; }

/* verticalUser, horizontalAuthor component dark overrides */
.dark .vertical-user-name,
.dark .horizontal-author-name { color: #e2e8f0; }

/* Loader dark mode */
.dark .loader-img { filter: brightness(0.8); }

/* =============================================
   Global slate text/border/bg overrides
   ============================================= */

/* Slate text → lighter in dark mode */
.dark [class~="text-slate-800"] { color: #e2e8f0 !important; }
.dark [class~="text-slate-700"] { color: #cbd5e1 !important; }
.dark [class~="text-slate-600"] { color: #94a3b8 !important; }
.dark [class~="text-slate-500"] { color: #94a3b8 !important; }

/* Slate borders → darker in dark mode */
.dark [class~="border-slate-200"] { border-color: #334155 !important; }
.dark [class~="border-slate-100"] { border-color: #1e293b !important; }
.dark [class~="border-slate-300"] { border-color: #475569 !important; }

/* Slate bg-slate-200 (tooltips, help circles) */
.dark [class~="bg-slate-200"] { background: #334155 !important; }

/* Divider colors */
.dark [class~="divide-slate-100"] > * + * { border-color: #334155 !important; }

/* Hover backgrounds */
.dark [class~="hover\:bg-slate-100"]:hover { background: #334155 !important; }
.dark [class~="hover\:bg-slate-200"]:hover { background: #475569 !important; }
.dark [class~="hover\:bg-primary-100"]:hover { background: rgba(49, 46, 129, 0.4) !important; }
.dark [class~="hover\:bg-primary-50"]:hover { background: rgba(49, 46, 129, 0.3) !important; }
.dark [class~="hover\:bg-emerald-100"]:hover { background: rgba(6, 78, 59, 0.4) !important; }
.dark [class~="hover\:bg-amber-100"]:hover { background: rgba(120, 53, 15, 0.4) !important; }
.dark [class~="hover\:bg-red-100"]:hover { background: rgba(127, 29, 29, 0.4) !important; }
.dark [class~="hover\:bg-cyan-100"]:hover { background: rgba(22, 78, 99, 0.4) !important; }

/* Blue info boxes */
.dark [class~="bg-blue-50"] { background: rgba(30, 58, 138, 0.3) !important; }
.dark [class~="bg-blue-100"] { background: rgba(30, 58, 138, 0.4) !important; }
.dark [class~="border-blue-100"] { border-color: rgba(30, 64, 175, 0.5) !important; }
.dark [class~="text-blue-800"] { color: #93c5fd !important; }
.dark [class~="text-amber-800"] { color: #fcd34d !important; }

/* bg-white → dark surface */
.dark [class~="bg-white"]:not(body):not(.modal-content) { background: #1e293b !important; }
.dark [class~="bg-white\/90"] { background: rgba(30, 41, 59, 0.9) !important; }

/* Pink info boxes (stats) */
.dark [class~="bg-pink-50"] { background: rgba(136, 19, 55, 0.3) !important; }

/* Hover borders */
.dark [class~="hover\:border-slate-300"]:hover { border-color: #475569 !important; }
.dark [class~="hover\:border-primary-400"]:hover { border-color: #818cf8 !important; }

/* connectedStyle overrides */
.dark .sidebar { background: #0f172a; border-right-color: #334155; }
.dark .top-navbar { background: #1e293b; border-bottom-color: #334155; }
.dark .main-content { background: #0f172a; }
