/* ===== Designet Formation — extras : RTL arabe, mode sombre, visionneuse ===== */
.theme-sun { display: none; }
[data-bs-theme="dark"] .theme-sun { display: inline; }
[data-bs-theme="dark"] .theme-moon { display: none; }

/* ---------- RTL (arabe) ---------- */
[dir="rtl"] { --bs-body-font-family: 'Cairo', 'Poppins', system-ui, sans-serif; }
[dir="rtl"] body { font-family: 'Cairo', 'Poppins', system-ui, sans-serif; text-align: right; }
[dir="rtl"] .sidebar { inset: 0 0 0 auto; border-right: 0; border-left: 1px solid #e6edf5; }
[dir="rtl"] .app-main { margin-left: 0; margin-right: 268px; }
[dir="rtl"] .sidebar .nav-link .badge { margin-left: 0; margin-right: auto; }
[dir="rtl"] .toast-zone { right: auto; left: 20px; }
[dir="rtl"] .toast-ds { border-left: 0; border-right: 4px solid var(--ds-cyan); }
[dir="rtl"] #installApp { left: auto !important; right: 20px; }
[dir="rtl"] .notif-badge { right: auto; left: -4px; }
[dir="rtl"] .formation-cover .ribbon { right: auto; left: 12px; }
[dir="rtl"] .bi-arrow-right, [dir="rtl"] .bi-arrow-left { display: inline-block; transform: scaleX(-1); }
[dir="rtl"] .dataTables_wrapper .dataTables_filter { text-align: left; }
[dir="rtl"] .dataTables_wrapper .dataTables_paginate { text-align: left; }
[dir="rtl"] .float-end { float: left !important; }
[dir="rtl"] .accordion-button::after { margin-left: 0; margin-right: auto; }
[dir="rtl"] .hero .shape { right: auto !important; left: 6%; }
@media (max-width: 991.98px) {
  [dir="rtl"] .sidebar { transform: translateX(100%); }
  [dir="rtl"] .sidebar.open { transform: translateX(0); }
  [dir="rtl"] .app-main { margin-right: 0; }
}

/* ---------- Mode sombre ---------- */
[data-bs-theme="dark"] {
  --ds-bg: #0d1927; --ds-text: #dbe6f2; --ds-muted: #8fa3ba; --ds-light: #16304a;
  --ds-shadow: 0 6px 24px rgba(0, 0, 0, .4);
  --bs-body-bg: #0d1927; --bs-body-color: #dbe6f2;
  --bs-link-color: #5cb6ea; --bs-link-hover-color: #9fd3f3;
  --bs-border-color: #22395a;
}
[data-bs-theme="dark"] h1, [data-bs-theme="dark"] h2, [data-bs-theme="dark"] h3,
[data-bs-theme="dark"] h4, [data-bs-theme="dark"] h5, [data-bs-theme="dark"] h6,
[data-bs-theme="dark"] .stat-value, [data-bs-theme="dark"] .card-header,
[data-bs-theme="dark"] .form-label, [data-bs-theme="dark"] .notif-item .n-title { color: #e8f1fa; }
[data-bs-theme="dark"] .sidebar { background: #101f31; border-color: #1f3350; }
[data-bs-theme="dark"] .sidebar .nav-link { color: #b6c7da; }
[data-bs-theme="dark"] .sidebar .nav-link:hover { background: #1a3350; color: #7fcbf2; }
[data-bs-theme="dark"] .sidebar .nav-link.active { color: #fff; }
[data-bs-theme="dark"] .sidebar .sidebar-foot { border-color: #1f3350; }
[data-bs-theme="dark"] .sidebar .brand img, [data-bs-theme="dark"] .public-nav .navbar-brand img {
  background: #fff; border-radius: 14px; padding: 6px 10px;
}
[data-bs-theme="dark"] .sidebar .role-pill { background: #17304a; color: #7fcbf2; }
[data-bs-theme="dark"] .topbar { background: rgba(16, 31, 49, .9); border-color: #1f3350; }
[data-bs-theme="dark"] .stat-card, [data-bs-theme="dark"] .cat-tile, [data-bs-theme="dark"] .step-box,
[data-bs-theme="dark"] .auth-form, [data-bs-theme="dark"] .notif-menu, [data-bs-theme="dark"] .toast-ds { background: #132338; }
[data-bs-theme="dark"] .public-nav { background: rgba(16, 31, 49, .95); }
[data-bs-theme="dark"] .public-nav .nav-link { color: #dbe6f2; }
[data-bs-theme="dark"] .card { background: #132338; }
[data-bs-theme="dark"] .card-header { border-color: #22395a; }
[data-bs-theme="dark"] .btn-icon { background: #1a3350; color: #dbe6f2; }
[data-bs-theme="dark"] .btn-icon:hover { background: #22446a; }
[data-bs-theme="dark"] .form-control, [data-bs-theme="dark"] .form-select { background-color: #0d1927; border-color: #2a4262; color: #dbe6f2; }
[data-bs-theme="dark"] .form-control::placeholder { color: #6f849c; }
[data-bs-theme="dark"] .table thead th { background: #112137; color: #8fa3ba; border-color: #22395a; }
[data-bs-theme="dark"] .table { --bs-table-bg: transparent; --bs-table-color: #dbe6f2; --bs-table-border-color: #1f3350; }
[data-bs-theme="dark"] .notif-item { border-color: #1b3049; }
[data-bs-theme="dark"] .notif-item.unread { background: #17314d; }
[data-bs-theme="dark"] .notif-item:hover { background: #162c46; }
[data-bs-theme="dark"] .notif-head { border-color: #22395a; }
[data-bs-theme="dark"] .notif-foot { background: #112137; }
[data-bs-theme="dark"] .notif-item .n-msg { color: #9fb2c8; }
[data-bs-theme="dark"] .progress { background: #1f3350; }
[data-bs-theme="dark"] .list-group-item { background: transparent; border-color: #1f3350; color: #dbe6f2; }
[data-bs-theme="dark"] .accordion-item { background: #132338; color: #dbe6f2; }
[data-bs-theme="dark"] .accordion-button { background: #132338; color: #e8f1fa; }
[data-bs-theme="dark"] .accordion-button:not(.collapsed) { background: #17314d; color: #7fcbf2; }
[data-bs-theme="dark"] .accordion-button::after { filter: invert(1) grayscale(1); }
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"] .dataTables_wrapper .dataTables_length select { background: #0d1927; border-color: #2a4262; color: #dbe6f2; }
[data-bs-theme="dark"] .page-link { background: #132338; border-color: #22395a; }
[data-bs-theme="dark"] .page-item.disabled .page-link { background: #0f1c2d; }
[data-bs-theme="dark"] .dropdown-menu { background: #132338; border: 1px solid #22395a; }
[data-bs-theme="dark"] .dropdown-item { color: #dbe6f2; }
[data-bs-theme="dark"] .dropdown-item:hover { background: #1a3350; }
[data-bs-theme="dark"] .auth-wrap, [data-bs-theme="dark"] .auth-form { background: #0d1927; }
[data-bs-theme="dark"] .text-muted { color: #8fa3ba !important; }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: #5cb6ea; --bs-btn-border-color: #2f6f9f; }
[data-bs-theme="dark"] .alert-info { background: #11344f; color: #bfe2f8; border-color: #1c4d72; }
[data-bs-theme="dark"] .modal-content { background: #132338; }
