/* ==================== Dark Mode ==================== */
[data-bs-theme="dark"] {
  /* Primary color - softer for dark backgrounds */
  --bs-primary: #7c7fff;
  --bs-primary-rgb: 124, 127, 255;
  --bs-primary-text-emphasis: #b0b2ff;
  --bs-primary-bg-subtle: rgba(124, 127, 255, 0.12);
  --bs-primary-border-subtle: rgba(124, 127, 255, 0.25);

  /* Body */
  --bs-body-bg: #1a1d21;
  --bs-body-bg-rgb: 26, 29, 33;
  --bs-body-color: #c4c7cc;
  --bs-body-color-rgb: 196, 199, 204;
  --bs-heading-color: #e1e3e6;
  --bs-emphasis-color: #f0f2f5;
  --bs-emphasis-color-rgb: 240, 242, 245;
  --bs-secondary-color: rgba(196, 199, 204, 0.75);
  --bs-secondary-bg: #2a2d32;
  --bs-tertiary-bg: #232629;
  --bs-border-color: #4a4d55;
  --bs-border-color-translucent: rgba(255, 255, 255, 0.1);
  --bs-link-color: #9b9eff;
  --bs-link-color-rgb: 155, 158, 255;
  --bs-link-hover-color: #b5b7ff;
  --bs-link-hover-color-rgb: 181, 183, 255;
  --bs-code-color: #f78da7;

  /* Softer contextual colors */
  --bs-success: #7be048;
  --bs-info: #2ecef5;
  --bs-warning: #ffba33;
  --bs-danger: #ff6b52;

  /* Theme color overrides */
  --theme-color-main: #7c7fff;
  --theme-color-light: #9b9eff;
  --theme-color-bg: rgba(124, 127, 255, 0.8);
  --theme-color-hover: rgba(124, 127, 255, 0.08);

  /* Nav tabs */
  --bs-nav-tabs-link-active-color: #9b9eff;
  --bs-nav-tabs-link-active-bg: #22262a;
  --bs-nav-tabs-link-active-border-color: #7c7fff;

  /* Pagination */
  --bs-pagination-color: #c4c7cc;
  --bs-pagination-bg: #2a2d32;
  --bs-pagination-border-color: #4a4d55;
  --bs-pagination-hover-color: #e1e3e6;
  --bs-pagination-hover-bg: #333840;
  --bs-pagination-hover-border-color: #585c66;
  --bs-pagination-focus-color: #e1e3e6;
  --bs-pagination-focus-bg: #333840;
  --bs-pagination-active-color: #fff;
  --bs-pagination-active-bg: #7c7fff;
  --bs-pagination-active-border-color: #7c7fff;
  --bs-pagination-disabled-color: #4a4d55;
  --bs-pagination-disabled-bg: #1e2125;
  --bs-pagination-disabled-border-color: #3a3d42;

  /* Card */
  --bs-card-border-color: #4a4d55;
  --bs-card-bg: #22262a;

  color-scheme: dark;
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .layout-page,
[data-bs-theme="dark"] .content-wrapper {
  background-color: #1a1d21 !important;
  color: #c4c7cc;
}

/* Cards */
[data-bs-theme="dark"] .card {
  background-color: #22262a !important;
  border-color: #3a3d42 !important;
  color: #c4c7cc;
}

[data-bs-theme="dark"] .card-header {
  border-color: #3a3d42 !important;
}

/* Primary button - softer in dark mode */
[data-bs-theme="dark"] .btn-primary {
  background-color: #7c7fff;
  border-color: #7c7fff;
  color: #fff;
}

[data-bs-theme="dark"] .btn-primary:hover {
  background-color: #6a6df0;
  border-color: #6a6df0;
  color: #fff;
}

[data-bs-theme="dark"] .btn-primary:focus,
[data-bs-theme="dark"] .btn-primary.focus {
  box-shadow: 0 0 0 0.15rem rgba(124, 127, 255, 0.35);
}

/* Outline/label primary */
[data-bs-theme="dark"] .btn-outline-primary {
  color: #9b9eff;
  border-color: #7c7fff;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
  background-color: rgba(124, 127, 255, 0.15);
  color: #b5b7ff;
  border-color: #9b9eff;
}

[data-bs-theme="dark"] .btn-label-primary {
  background-color: rgba(124, 127, 255, 0.12);
  color: #9b9eff;
  border-color: transparent;
}

[data-bs-theme="dark"] .btn-label-primary:hover {
  background-color: rgba(124, 127, 255, 0.22);
  color: #b5b7ff;
}

/* Navbar / Menu */
[data-bs-theme="dark"] .bg-primary:not(.btn) {
  background-color: #1e2030 !important;
}

[data-bs-theme="dark"] #main-menu {
  background-color: #1a1c2e !important;
}

[data-bs-theme="dark"] .dropdown-menu {
  background-color: #2a2d32;
  border-color: #3a3d42;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .dropdown-item {
  color: #c4c7cc;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
  background-color: rgba(124, 127, 255, 0.1);
  color: #e1e3e6;
}

[data-bs-theme="dark"] .dropdown-item.active {
  background-color: rgba(124, 127, 255, 0.2);
  color: #b5b7ff;
}

/* Tables */
[data-bs-theme="dark"] .table {
  --bs-table-bg: transparent;
  --bs-table-color: #c4c7cc;
  --bs-table-border-color: #4a4d55;
  --bs-table-striped-bg: #2c3136;
  --bs-table-striped-color: #c4c7cc;
  --bs-table-active-bg: rgba(124, 127, 255, 0.12);
  --bs-table-active-color: #c4c7cc;
  --bs-table-hover-bg: #333840;
  --bs-table-hover-color: #e1e3e6;
  --bs-table-accent-bg: transparent;
}

[data-bs-theme="dark"] .table> :not(caption)>*>* {
  background-color: #22262a;
  border-bottom-color: #4a4d55 !important;
  color: #c4c7cc;
  box-shadow: none !important;
}

[data-bs-theme="dark"] .table>thead>tr>* {
  background-color: #1a1e22 !important;
  color: #e1e3e6;
  border-bottom-color: #585c66 !important;
  font-weight: 600;
}

[data-bs-theme="dark"] .table-bordered> :not(caption)>* {
  border-color: #4a4d55;
}

[data-bs-theme="dark"] .table-bordered> :not(caption)>*>* {
  border-color: #4a4d55;
}

[data-bs-theme="dark"] .nav-align-top .table:not(.table-dark),
[data-bs-theme="dark"] .nav-align-top .table:not(.table-dark) thead:not(.table-dark) th,
[data-bs-theme="dark"] .nav-align-top .table:not(.table-dark) tfoot:not(.table-dark) th,
[data-bs-theme="dark"] .nav-align-top .table:not(.table-dark) td,
[data-bs-theme="dark"] .nav-align-right .table:not(.table-dark),
[data-bs-theme="dark"] .nav-align-right .table:not(.table-dark) td,
[data-bs-theme="dark"] .nav-align-bottom .table:not(.table-dark),
[data-bs-theme="dark"] .nav-align-bottom .table:not(.table-dark) td,
[data-bs-theme="dark"] .nav-align-left .table:not(.table-dark),
[data-bs-theme="dark"] .nav-align-left .table:not(.table-dark) td {
  border-color: #4a4d55 !important;
}

[data-bs-theme="dark"] .table-group-divider {
  border-top-color: #585c66;
}

[data-bs-theme="dark"] .table-striped>tbody>tr:nth-of-type(odd)>* {
  background-color: #2c3136 !important;
  color: #c4c7cc;
}

[data-bs-theme="dark"] .table-hover>tbody>tr:hover>* {
  background-color: #333840 !important;
  color: #e1e3e6;
}

[data-bs-theme="dark"] .table-active>td,
[data-bs-theme="dark"] .table-active>th,
[data-bs-theme="dark"] tr.table-active>* {
  background-color: rgba(124, 127, 255, 0.12) !important;
}

/* Table row action icons (dots menu) */
[data-bs-theme="dark"] .table .btn.p-0,
[data-bs-theme="dark"] .table .btn.dropdown-toggle {
  color: #8a8e94;
}

[data-bs-theme="dark"] .table .btn.p-0:hover,
[data-bs-theme="dark"] .table .btn.dropdown-toggle:hover {
  color: #e1e3e6;
}

[data-bs-theme="dark"] .table .bx-dots-vertical-rounded,
[data-bs-theme="dark"] .table .bx-dots-vertical {
  color: #8a8e94;
}

/* Contextual table variants */
[data-bs-theme="dark"] .table-primary {
  --bs-table-bg: rgba(124, 127, 255, 0.1);
  --bs-table-color: #b5b7ff;
  --bs-table-border-color: #3a3d52;
}

[data-bs-theme="dark"] .table-secondary {
  --bs-table-bg: rgba(133, 146, 163, 0.1);
  --bs-table-color: #c4c7cc;
  --bs-table-border-color: #4a4d55;
}

[data-bs-theme="dark"] .table-success {
  --bs-table-bg: rgba(123, 224, 72, 0.1);
  --bs-table-color: #8be65a;
  --bs-table-border-color: #2e4a28;
}

[data-bs-theme="dark"] .table-danger {
  --bs-table-bg: rgba(255, 107, 82, 0.1);
  --bs-table-color: #ff8a75;
  --bs-table-border-color: #4a2e28;
}

[data-bs-theme="dark"] .table-warning {
  --bs-table-bg: rgba(255, 186, 51, 0.1);
  --bs-table-color: #ffca5c;
  --bs-table-border-color: #4a4028;
}

[data-bs-theme="dark"] .table-info {
  --bs-table-bg: rgba(46, 206, 245, 0.1);
  --bs-table-color: #5ed8f7;
  --bs-table-border-color: #28404a;
}

/* Card title */
[data-bs-theme="dark"] .card-title {
  color: #e1e3e6;
}

/* bg-light override */
[data-bs-theme="dark"] .bg-light {
  background-color: #22262a !important;
}

/* Breadcrumb */
[data-bs-theme="dark"] .breadcrumb-item a {
  color: #9b9eff;
}

[data-bs-theme="dark"] .breadcrumb-item.active {
  color: #c4c7cc;
}

/* Pagination - page numbers */
[data-bs-theme="dark"] .page-link {
  background-color: #2a2d32;
  border-color: #4a4d55;
  color: #c4c7cc;
}

[data-bs-theme="dark"] .page-link:hover {
  background-color: #333840;
  border-color: #585c66;
  color: #e1e3e6;
}

[data-bs-theme="dark"] .page-item.active .page-link {
  background-color: #7c7fff;
  border-color: #7c7fff;
  color: #fff;
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
  background-color: #1e2125;
  border-color: #3a3d42;
  color: #4a4d55;
}

/* Forms */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #2a2d32;
  border-color: #3a3d42;
  color: #c4c7cc;
  --bs-form-select-bg-img: url('data:image/svg+xml,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 22" fill="none"%3e%3cpath d="M10.9999 12.0743L15.5374 7.53676L16.8336 8.83292L10.9999 14.6666L5.16626 8.83292L6.46243 7.53676L10.9999 12.0743Z" fill="%23c4c7cc" fill-opacity="0.9"/%3e%3c/svg%3e');
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #32363b;
  border-color: #7c7fff;
  color: #e1e3e6;
  box-shadow: 0 0 0 0.15rem rgba(124, 127, 255, 0.2);
}

[data-bs-theme="dark"] .form-control::placeholder {
  color: #6c7178;
}

[data-bs-theme="dark"] .form-label,
[data-bs-theme="dark"] label,
[data-bs-theme="dark"] .col-form-label {
  color: #b0b4ba;
}

[data-bs-theme="dark"] .btn-close {
  filter: invert(1) grayscale(100%) brightness(200%);
}

[data-bs-theme="dark"] .modal .btn-close {
  background-color: transparent;
  box-shadow: none;
}

[data-bs-theme="dark"] .form-check-input {
  background-color: #2a2d32;
  border-color: #4a4d52;
}

[data-bs-theme="dark"] .form-check-input:checked {
  background-color: #7c7fff;
  border-color: #7c7fff;
}

/* Modals */
[data-bs-theme="dark"] .modal-content {
  background-color: #22262a;
  border-color: #3a3d42;
  color: #c4c7cc;
}

[data-bs-theme="dark"] .modal-header,
[data-bs-theme="dark"] .modal-footer {
  border-color: #3a3d42;
}

/* Buttons - secondary */
[data-bs-theme="dark"] .btn-label-secondary,
[data-bs-theme="dark"] .btn-outline-secondary {
  color: #c4c7cc;
  border-color: #4a4d52;
}

[data-bs-theme="dark"] .btn-label-secondary:hover {
  background-color: #32363b;
  color: #e1e3e6;
}

/* Footer */
[data-bs-theme="dark"] .bg-footer-theme,
[data-bs-theme="dark"] footer {
  background-color: #1a1c2e !important;
  color: #8a8e94;
}

/* Tabs */
[data-bs-theme="dark"] .nav-tabs,
[data-bs-theme="dark"] .nav .nav-tabs {
  background-color: #1a1d21 !important;
  border-color: #3a3d42;
}

[data-bs-theme="dark"] .nav-tabs-shadow {
  box-shadow: 0 0.1875rem 0.5rem 0 rgba(0, 0, 0, 0.25);
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
  color: #8a8e94;
  background-color: transparent;
  border-color: transparent;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
  color: #b5b7ff;
  background-color: rgba(124, 127, 255, 0.06);
  border-color: transparent;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
  background-color: #22262a;
  border-color: #3a3d42;
  border-bottom-color: transparent;
  color: #9b9eff;
  box-shadow: 0 -2px 0 #7c7fff inset;
}

[data-bs-theme="dark"] .nav-align-top .nav-tabs .nav-link.active,
[data-bs-theme="dark"] .nav-align-bottom .nav-tabs .nav-link.active {
  border-bottom-color: #7c7fff !important;
}

/* Nav items (horizontal navbar tabs) */
[data-bs-theme="dark"] .nav-item .nav-link {
  color: #8a8e94;
}

[data-bs-theme="dark"] .nav-item .nav-link:hover {
  color: #e1e3e6;
  background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme="dark"] .nav-item.active>.nav-link,
[data-bs-theme="dark"] .nav-item .nav-link.active {
  background-color: rgba(124, 127, 255, 0.12) !important;
  color: #b5b7ff !important;
}

/* Nav pills */
[data-bs-theme="dark"] .nav-pills .nav-link {
  color: #8a8e94;
}

[data-bs-theme="dark"] .nav-pills .nav-link:hover {
  color: #b5b7ff;
  background-color: rgba(124, 127, 255, 0.08);
}

[data-bs-theme="dark"] .nav-pills .nav-link.active {
  background-color: rgba(124, 127, 255, 0.15);
  color: #b5b7ff;
}

/* Badges */
[data-bs-theme="dark"] .badge.bg-label-info {
  background-color: rgba(46, 206, 245, 0.12) !important;
  color: #5ed8f7 !important;
}

[data-bs-theme="dark"] .badge.bg-label-primary {
  background-color: rgba(124, 127, 255, 0.12) !important;
  color: #9b9eff !important;
}

[data-bs-theme="dark"] .badge.bg-label-secondary {
  background-color: rgba(133, 146, 163, 0.15) !important;
  color: #a0a8b4 !important;
}

[data-bs-theme="dark"] .badge.bg-label-success {
  background-color: rgba(123, 224, 72, 0.12) !important;
  color: #8be65a !important;
}

[data-bs-theme="dark"] .badge.bg-label-warning {
  background-color: rgba(255, 186, 51, 0.12) !important;
  color: #ffca5c !important;
}

[data-bs-theme="dark"] .badge.bg-label-danger {
  background-color: rgba(255, 107, 82, 0.12) !important;
  color: #ff8a75 !important;
}

[data-bs-theme="dark"] .badge.bg-primary {
  background-color: rgba(124, 127, 255, 0.25) !important;
  color: #b5b7ff !important;
}

[data-bs-theme="dark"] .badge.bg-danger {
  background-color: rgba(255, 107, 82, 0.25) !important;
  color: #ff8a75 !important;
}

[data-bs-theme="dark"] .badge.bg-success {
  background-color: rgba(123, 224, 72, 0.25) !important;
  color: #8be65a !important;
}

[data-bs-theme="dark"] .badge.bg-warning {
  background-color: rgba(255, 186, 51, 0.25) !important;
  color: #ffca5c !important;
}

[data-bs-theme="dark"] .badge.bg-info {
  background-color: rgba(46, 206, 245, 0.25) !important;
  color: #5ed8f7 !important;
}

[data-bs-theme="dark"] .badge.bg-secondary {
  background-color: rgba(133, 146, 163, 0.25) !important;
  color: #a0a8b4 !important;
}

/* bg helpers */
[data-bs-theme="dark"] .bg-white {
  background-color: #22262a !important;
}

[data-bs-theme="dark"] .bg-transparent {
  background-color: transparent !important;
}

/* Text colors */
[data-bs-theme="dark"] .text-primary {
  color: #9b9eff !important;
}

[data-bs-theme="dark"] .text-muted {
  color: #6c7178 !important;
}

[data-bs-theme="dark"] .text-secondary {
  color: #8a8e94 !important;
}

[data-bs-theme="dark"] .text-info {
  color: #5ed8f7 !important;
}

[data-bs-theme="dark"] .text-danger {
  color: #ff8a75 !important;
}

[data-bs-theme="dark"] .text-success {
  color: #8be65a !important;
}

/* Toast */
[data-bs-theme="dark"] .toast {
  background-color: #2a2d32;
  border-color: #3a3d42;
  color: #c4c7cc;
}

[data-bs-theme="dark"] .toast-header {
  background-color: transparent;
  border-color: transparent;
  color: inherit;
}

[data-bs-theme="dark"] .toast-body {
  color: #c4c7cc;
}

[data-bs-theme="dark"] .bg-success.toast,
[data-bs-theme="dark"] .bg-success.bs-toast {
  background-color: #264d38 !important;
  color: #55d98d !important;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .bg-success.toast .toast-header,
[data-bs-theme="dark"] .bg-success.bs-toast .toast-header {
  color: #55d98d;
  background-color: transparent;
}

[data-bs-theme="dark"] .bg-danger.toast,
[data-bs-theme="dark"] .bg-danger.bs-toast {
  background-color: #4d2626 !important;
  color: #f08182 !important;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .bg-warning.toast,
[data-bs-theme="dark"] .bg-warning.bs-toast {
  background-color: #4d3c26 !important;
  color: #ffb976 !important;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .bg-info.toast,
[data-bs-theme="dark"] .bg-info.bs-toast {
  background-color: #263c4d !important;
  color: #6eddf7 !important;
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.3);
}

/* Select2 */
[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
  background-color: #2a2d32;
  border-color: #3a3d42;
  color: #c4c7cc;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-dropdown {
  background-color: #2a2d32;
  border-color: #3a3d42;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-results__option--highlighted {
  background-color: rgba(124, 127, 255, 0.2);
  color: #b5b7ff;
}

/* Sticky header override */
[data-bs-theme="dark"] .sticky-top.bg-white {
  background-color: #22262a !important;
}

/* Page links & active nav */
[data-bs-theme="dark"] .nav-link.active,
[data-bs-theme="dark"] a.active {
  color: #9b9eff;
}

/* Pagination */
[data-bs-theme="dark"] .page-link {
  background-color: #2a2d32;
  border-color: #3a3d42;
  color: #c4c7cc;
}

[data-bs-theme="dark"] .page-item.active .page-link {
  background-color: #7c7fff;
  border-color: #7c7fff;
}

/* Scrollbar */
[data-bs-theme="dark"] ::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
  background: #1a1d21;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #3a3d42;
  border-radius: 4px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #4a4d52;
}

/* ==================== Dark Mode Toggle ==================== */
.dark-mode-toggle {
  cursor: pointer;
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  padding: 0.25rem 0.5rem;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
}

.dark-mode-toggle:hover {
  transform: scale(1.15);
}

.dark-mode-toggle i {
  transition: transform 0.3s ease;
}

/* ==================== Profile Avatar ==================== */
.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c7fff, #5b5ecc);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid rgba(255, 255, 255, 0.25);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.profile-avatar:hover {
  border-color: rgba(255, 255, 255, 0.5);
  transform: scale(1.05);
}

.profile-dropdown .dropdown-toggle::after {
  display: none;
}

.profile-dropdown .dropdown-menu {
  min-width: 160px;
}

.profile-dropdown .dropdown-header {
  font-size: 0.8rem;
  color: #8a8e94;
  padding: 0.5rem 1rem;
}

/* ==================== Quill Editor Dark Mode ==================== */
[data-bs-theme="dark"] .ql-toolbar.ql-snow {
  background-color: #2a2d32;
  border-color: #4a4d55 !important;
}

[data-bs-theme="dark"] .ql-container.ql-snow {
  border-color: #4a4d55 !important;
}

[data-bs-theme="dark"] .ql-editor {
  background-color: #22262a;
  color: #c4c7cc;
}

[data-bs-theme="dark"] .ql-editor.ql-blank::before {
  color: #6c7178;
}

[data-bs-theme="dark"] .ql-snow .ql-stroke {
  stroke: #8a8e94 !important;
}

[data-bs-theme="dark"] .ql-snow .ql-fill,
[data-bs-theme="dark"] .ql-snow .ql-stroke.ql-fill {
  fill: #8a8e94 !important;
}

[data-bs-theme="dark"] .ql-snow .ql-picker {
  color: #c4c7cc;
}

[data-bs-theme="dark"] .ql-snow .ql-picker-options {
  background-color: #2a2d32;
  border-color: #4a4d55;
}

[data-bs-theme="dark"] .ql-snow .ql-picker-label:hover .ql-stroke,
[data-bs-theme="dark"] .ql-snow button:hover .ql-stroke {
  stroke: #b5b7ff !important;
}

[data-bs-theme="dark"] .ql-snow .ql-picker-label:hover .ql-fill,
[data-bs-theme="dark"] .ql-snow button:hover .ql-fill {
  fill: #b5b7ff !important;
}

[data-bs-theme="dark"] .ql-snow .ql-active .ql-stroke {
  stroke: #9b9eff !important;
}

[data-bs-theme="dark"] .ql-snow .ql-active .ql-fill {
  fill: #9b9eff !important;
}

[data-bs-theme="dark"] .ql-snow .ql-picker-label:hover,
[data-bs-theme="dark"] .ql-snow button:hover {
  color: #b5b7ff;
}

[data-bs-theme="dark"] .ql-toolbar.ql-snow .ql-picker.ql-expanded .ql-picker-label {
  border-color: #4a4d55;
}

[data-bs-theme="dark"] .ql-snow .ql-tooltip {
  background-color: #2a2d32;
  border-color: #4a4d55;
  color: #c4c7cc;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ==================== Table Links ==================== */
[data-bs-theme="dark"] .table a,
[data-bs-theme="dark"] a.underline {
  color: #9b9eff;
}

[data-bs-theme="dark"] .table a:hover,
[data-bs-theme="dark"] a.underline:hover {
  color: #b5b7ff;
}

/* ==================== Quill RTL Fix ==================== */
[dir="rtl"] .quill-editor-wrap {
  direction: ltr;
}

[dir="rtl"] .ql-toolbar.ql-snow,
[dir="rtl"] .ql-toolbar.ql-snow *,
[dir="rtl"] .ql-container.ql-snow {
  direction: ltr;
}

[dir="rtl"] .ql-toolbar.ql-snow button,
[dir="rtl"] .ql-toolbar.ql-snow button svg,
[dir="rtl"] .ql-toolbar.ql-snow .ql-formats {
  transform: none !important;
}

[dir="rtl"] .ql-snow .ql-picker {
  direction: ltr;
}

[dir="rtl"] .ql-snow .ql-picker-label svg,
[dir="rtl"] .ql-snow .ql-picker-label svg polygon {
  transform: scaleX(1) !important;
}

[dir="rtl"] .ql-snow .ql-picker-options {
  direction: ltr;
}

[dir="rtl"] .ql-editor {
  direction: rtl;
  text-align: right;
}

/* ==================== Global Border Fix ==================== */
[data-bs-theme="dark"] .border {
  border-color: #4a4d55 !important;
}

[data-bs-theme="dark"] .border-top {
  border-top-color: #4a4d55 !important;
}

[data-bs-theme="dark"] .border-bottom {
  border-bottom-color: #4a4d55 !important;
}

[data-bs-theme="dark"] .border-start {
  border-inline-start-color: #4a4d55 !important;
}

[data-bs-theme="dark"] .border-end {
  border-inline-end-color: #4a4d55 !important;
}

[data-bs-theme="dark"] hr {
  color: #4a4d55;
}

/* Alert boxes */
[data-bs-theme="dark"] .alert-danger {
  background-color: rgba(255, 107, 82, 0.12);
  border-color: rgba(255, 107, 82, 0.2);
  color: #ff8a75;
}

[data-bs-theme="dark"] .alert-warning {
  background-color: rgba(255, 186, 51, 0.12);
  border-color: rgba(255, 186, 51, 0.2);
  color: #ffca5c;
}

[data-bs-theme="dark"] .alert-info {
  background-color: rgba(46, 206, 245, 0.12);
  border-color: rgba(46, 206, 245, 0.2);
  color: #5ed8f7;
}

[data-bs-theme="dark"] .alert-success {
  background-color: rgba(123, 224, 72, 0.12);
  border-color: rgba(123, 224, 72, 0.2);
  color: #8be65a;
}

/* ==================== Dark mode table & text fixes ==================== */
[data-bs-theme="dark"] .text-xs,
[data-bs-theme="dark"] span.col-auto {
  color: #c4c7cc !important;
}

[data-bs-theme="dark"] .border-top {
  border-top-color: #4a4d55 !important;
}

[data-bs-theme="dark"] thead {
  background-color: #22262a;
}

/* ==================== RTL Pagination Chevron Flip ==================== */
[dir="rtl"] .bx-chevrons-left,
[dir="rtl"] .bx-chevrons-right,
[dir="rtl"] .bx-chevron-left,
[dir="rtl"] .bx-chevron-right {
  transform: scaleX(-1);
}

/* ==================== RTL Navbar Fix ==================== */
[dir="rtl"] #main-menu,
[dir="rtl"] #main-menu * {
  transform: none !important;
}

.drag-target {
  pointer-events: none !important;
}