form {
    margin-bottom: 0;
}

/* SweetAlert Container Z-Index */
.swal2-container {
    z-index: 999999 !important;
}

/* SweetAlert Base Toast Popup */
.swal2-container.swal2-top-end .swal2-popup.swal2-toast,
.swal2-popup.swal2-toast,
.quizverse-toast-popup {
    display: flex !important;
    align-items: center !important;
    background-color: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    border-left: 5px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1) !important;
    padding: 12px 16px !important;
    overflow: visible !important;
}

/* Icons inside Toast should preserve flex layout & icon colors */
.swal2-popup.swal2-toast .swal2-icon,
.quizverse-toast-popup .swal2-icon {
    display: flex !important;
}

/* Success Toast Variant (Green) */
.swal2-popup.swal2-toast.swal2-icon-success,
.swal2-popup.swal2-toast:has(.swal2-icon-success) {
    border-left: 5px solid #2fb344 !important;
}
.swal2-popup.swal2-toast:has(.swal2-icon-success) .swal2-timer-progress-bar {
    background-color: #2fb344 !important;
}

/* Error Toast Variant (Red) */
.swal2-popup.swal2-toast.swal2-icon-error,
.swal2-popup.swal2-toast:has(.swal2-icon-error) {
    border-left: 5px solid #d63939 !important;
}
.swal2-popup.swal2-toast:has(.swal2-icon-error) .swal2-timer-progress-bar {
    background-color: #d63939 !important;
}

/* Warning Toast Variant (Orange) */
.swal2-popup.swal2-toast.swal2-icon-warning,
.swal2-popup.swal2-toast:has(.swal2-icon-warning) {
    border-left: 5px solid #f59e0b !important;
}
.swal2-popup.swal2-toast:has(.swal2-icon-warning) .swal2-timer-progress-bar {
    background-color: #f59e0b !important;
}

/* Toast Text Styling for Title & HTML Container */
.swal2-popup.swal2-toast .swal2-title,
.swal2-popup.swal2-toast .swal2-html-container,
.swal2-container .swal2-popup.swal2-toast .swal2-title,
.swal2-container .swal2-popup.swal2-toast .swal2-html-container,
.quizverse-toast-title,
.quizverse-toast-popup .swal2-title,
.quizverse-toast-popup .swal2-html-container {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #0f172a !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    margin: 0 0 0 8px !important;
    padding: 0 !important;
    text-align: left !important;
    white-space: normal !important;
}

/* Dark mode toast override */
[data-bs-theme="dark"] .swal2-container.swal2-top-end .swal2-popup.swal2-toast,
[data-bs-theme="dark"] .swal2-popup.swal2-toast,
[data-bs-theme="dark"] .quizverse-toast-popup {
    background-color: #1e293b !important;
    color: #f8fafc !important;
    border-color: #334155 !important;
}

[data-bs-theme="dark"] .swal2-popup.swal2-toast .swal2-title,
[data-bs-theme="dark"] .swal2-popup.swal2-toast .swal2-html-container,
[data-bs-theme="dark"] .quizverse-toast-title,
[data-bs-theme="dark"] .quizverse-toast-popup .swal2-title,
[data-bs-theme="dark"] .quizverse-toast-popup .swal2-html-container {
    color: #ffffff !important;
}

/* Sidebar Nav Link & Hover Whiteness Fix */
.navbar-dark .nav-link,
.navbar-dark .dropdown-item,
.navbar-dark .nav-link-title {
    color: rgba(255, 255, 255, 0.88) !important;
    font-weight: 500 !important;
}

.navbar-dark .nav-link:hover,
.navbar-dark .nav-link:focus,
.navbar-dark .dropdown-item:hover,
.navbar-dark .dropdown-item:focus,
.navbar-dark .nav-item.active > .nav-link,
.navbar-dark .dropdown-item.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.15) !important;
    font-weight: 700 !important;
}

.navbar-dark .dropdown-header {
    color: #60a5fa !important;
    font-weight: 700 !important;
    font-size: 11px !important;
    letter-spacing: 0.05em !important;
}

/* Status Badges & Chips Text Contrast */
.badge.bg-success {
    color: #ffffff !important;
    background-color: #2fb344 !important;
}
.badge.bg-secondary {
    color: #ffffff !important;
    background-color: #6c757d !important;
}
.badge.bg-danger {
    color: #ffffff !important;
    background-color: #d63939 !important;
}
.badge.bg-primary {
    color: #ffffff !important;
    background-color: #206bc4 !important;
}
.badge.bg-warning {
    color: #ffffff !important;
    background-color: #f59f00 !important;
}
.badge.bg-info {
    color: #ffffff !important;
    background-color: #4299e1 !important;
}

/* ==========================================================================
   GLOBAL DARK MODE ENHANCEMENTS & CONTRAST FIXES
   ========================================================================== */

/* Fix text-dark becoming invisible in dark mode (keep text dark only on light badges) */
[data-bs-theme="dark"] .text-dark:not(.badge) {
    color: var(--tblr-body-color, #f8fafc) !important;
}
[data-bs-theme="dark"] h1.text-dark,
[data-bs-theme="dark"] h2.text-dark,
[data-bs-theme="dark"] h3.text-dark,
[data-bs-theme="dark"] h4.text-dark,
[data-bs-theme="dark"] h5.text-dark,
[data-bs-theme="dark"] h6.text-dark,
[data-bs-theme="dark"] .card-title.text-dark,
[data-bs-theme="dark"] .card-header .text-dark,
[data-bs-theme="dark"] div.text-dark,
[data-bs-theme="dark"] span.text-dark:not(.badge),
[data-bs-theme="dark"] label.text-dark,
[data-bs-theme="dark"] p.text-dark,
[data-bs-theme="dark"] td.text-dark,
[data-bs-theme="dark"] th.text-dark {
    color: #f8fafc !important;
}

/* Ensure question statement and table titles are high contrast in dark mode */
[data-bs-theme="dark"] .col-question,
[data-bs-theme="dark"] .col-cat,
[data-bs-theme="dark"] .col-level,
[data-bs-theme="dark"] .col-created,
[data-bs-theme="dark"] .table td,
[data-bs-theme="dark"] .table th {
    color: #f8fafc !important;
}

/* Media Preview boxes, File Inputs & Dashed Upload Containers */
[data-bs-theme="dark"] .media-preview-box,
[data-bs-theme="dark"] .card.media-preview-box,
[data-bs-theme="dark"] #mathPreviewBox,
[data-bs-theme="dark"] .border-dashed {
    background-color: var(--tblr-bg-surface-secondary, #1e293b) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}

/* DropZone in Import Questions */
[data-bs-theme="dark"] #dropZone {
    background-color: var(--tblr-bg-surface-secondary, #1e293b) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    color: #f8fafc !important;
}
[data-bs-theme="dark"] #dropZone h4,
[data-bs-theme="dark"] #dropZone p {
    color: #f8fafc !important;
}
[data-bs-theme="dark"] #dropZone .text-muted {
    color: #94a3b8 !important;
}

/* Card headers with bg-light in dark mode */
[data-bs-theme="dark"] .card-header.bg-light,
[data-bs-theme="dark"] .bg-light:not(.badge) {
    background-color: rgba(255, 255, 255, 0.04) !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

/* FilePond in Dark Mode */
[data-bs-theme="dark"] .filepond--panel-root {
    background-color: var(--tblr-bg-surface-secondary, #1e293b) !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
[data-bs-theme="dark"] .filepond--drop-label {
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] .filepond--label-action {
    color: #60a5fa !important;
}

/* TomSelect in Dark Mode */
[data-bs-theme="dark"] .ts-control {
    background-color: var(--tblr-bg-surface, #1e293b) !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
[data-bs-theme="dark"] .ts-dropdown {
    background-color: var(--tblr-bg-surface, #1e293b) !important;
    color: #f8fafc !important;
    border-color: rgba(255, 255, 255, 0.15) !important;
}
[data-bs-theme="dark"] .ts-dropdown .option:hover,
[data-bs-theme="dark"] .ts-dropdown .active {
    background-color: rgba(255, 255, 255, 0.08) !important;
    color: #ffffff !important;
}

/* Ensure bg-dark-lt & badge.bg-dark-lt are clearly visible in dark mode */
[data-bs-theme="dark"] .bg-dark-lt {
    color: #e2e8f0 !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

[data-bs-theme="dark"] .badge.bg-dark,
[data-bs-theme="dark"] .badge.bg-dark-lt {
    color: #f8fafc !important;
    background-color: rgba(255, 255, 255, 0.12) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
}

/* High-contrast inline code, product IDs & hashes in dark mode */
[data-bs-theme="dark"] code,
[data-bs-theme="dark"] code.text-dark {
    color: #38bdf8 !important;
    background-color: rgba(56, 189, 248, 0.12) !important;
    border: 1px solid rgba(56, 189, 248, 0.25) !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

/* User select all utility for Txn / UUID / Order IDs */
.user-select-all {
    user-select: all !important;
    -webkit-user-select: all !important;
}

/* Tabler Icon Aliases & Fallbacks */
.ti-folder-sub:before {
    content: "\ef81" !important; /* ti-folders */
}
.ti-letters-case:before {
    content: "\eaed" !important; /* ti-letter-case */
}
.ti-layers:before {
    content: "\ef2e" !important; /* ti-stack-2 */
}



