/**
 * Dashboard dark mode (company + admin). Applies only under html[data-theme="dark"],
 * so the light theme is untouched. Loaded after style.css and custom.css.
 * Most of the dashboard reads the --mt-* variables; the rest are the template's
 * hard-coded light surfaces, re-coloured here.
 */

html[data-theme='dark'] {
    color-scheme: dark;
    --mt-primary: #a78bfa;
    --mt-primary-2: #8b5cf6;
    --mt-primary-soft: #2f1c57;
    --mt-text: #f1ecff;
    --mt-text-muted: #a8a1c0;
    --mt-border: #2f2350;
    --mt-bg: #120824;
    --mt-card: #1b0f36;
    --mt-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --mt-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    --mt-shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.55);
    --bs-body-bg: #120824;
    --bs-body-color: #f1ecff;
    --bs-border-color: #2f2350;
}

html[data-theme='dark'] body,
html[data-theme='dark'] #main-wrapper,
html[data-theme='dark'] .content-body {
    background-color: #120824 !important;
    color: #e6e0f5;
}

html[data-theme='dark'] h1, html[data-theme='dark'] h2, html[data-theme='dark'] h3,
html[data-theme='dark'] h4, html[data-theme='dark'] h5, html[data-theme='dark'] h6,
html[data-theme='dark'] .card-title, html[data-theme='dark'] .form-label, html[data-theme='dark'] label,
html[data-theme='dark'] strong, html[data-theme='dark'] .text-dark, html[data-theme='dark'] .text-black {
    color: #f1ecff !important;
}

html[data-theme='dark'] p, html[data-theme='dark'] li, html[data-theme='dark'] td, html[data-theme='dark'] th,
html[data-theme='dark'] span, html[data-theme='dark'] small, html[data-theme='dark'] div {
    border-color: #2f2350;
}

html[data-theme='dark'] .text-muted, html[data-theme='dark'] .text-secondary { color: #a8a1c0 !important; }

/* Surfaces */
html[data-theme='dark'] .card, html[data-theme='dark'] .card-header, html[data-theme='dark'] .card-footer,
html[data-theme='dark'] .header, html[data-theme='dark'] .nav-header, html[data-theme='dark'] .quixnav,
html[data-theme='dark'] .footer, html[data-theme='dark'] .page-titles, html[data-theme='dark'] .modal-content,
html[data-theme='dark'] .dropdown-menu, html[data-theme='dark'] .list-group-item, html[data-theme='dark'] .bg-white,
html[data-theme='dark'] .bg-light, html[data-theme='dark'] .accordion-item, html[data-theme='dark'] .accordion-button,
html[data-theme='dark'] .popover, html[data-theme='dark'] .offcanvas, html[data-theme='dark'] .wd-cand,
html[data-theme='dark'] .wd-gate__card, html[data-theme='dark'] .app-card, html[data-theme='dark'] .box-style {
    background-color: #1b0f36 !important;
    color: #e6e0f5;
    border-color: #2f2350 !important;
}

html[data-theme='dark'] .card { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important; }

/* Sidebar */
html[data-theme='dark'] .quixnav .metismenu a, html[data-theme='dark'] .quixnav .nav-text,
html[data-theme='dark'] .quixnav .metismenu i { color: #cfc6ea !important; }
html[data-theme='dark'] .quixnav .metismenu > li:hover > a,
html[data-theme='dark'] .quixnav .metismenu ul a:hover { background-color: #23143f !important; color: #fff !important; }
html[data-theme='dark'] .quixnav .metismenu > li.mm-active > a,
html[data-theme='dark'] .quixnav .metismenu > li.mm-active > a .nav-text,
html[data-theme='dark'] .quixnav .metismenu > li.mm-active > a i { color: #fff !important; }

/* Top bar */
html[data-theme='dark'] .mt-nav-link, html[data-theme='dark'] .header .nav-link,
html[data-theme='dark'] .header-profile > a, html[data-theme='dark'] .hamburger {
    background-color: #23143f !important;
    color: #e6e0f5 !important;
    border-color: #2f2350 !important;
}
html[data-theme='dark'] .hamburger .line { background: #c4b5fd !important; }

/* Forms */
html[data-theme='dark'] .form-control, html[data-theme='dark'] .form-select, html[data-theme='dark'] select,
html[data-theme='dark'] textarea, html[data-theme='dark'] .input-group-text,
html[data-theme='dark'] .select2-container--default .select2-selection--single,
html[data-theme='dark'] .select2-container--default .select2-selection--multiple,
html[data-theme='dark'] .select2-dropdown, html[data-theme='dark'] .select2-search__field,
html[data-theme='dark'] .note-editor, html[data-theme='dark'] .note-editable, html[data-theme='dark'] .note-toolbar,
html[data-theme='dark'] .flatpickr-calendar, html[data-theme='dark'] .wd-steps__item span::before {
    background-color: #23143f !important;
    color: #f1ecff !important;
    border-color: #40305f !important;
}
html[data-theme='dark'] .form-control::placeholder, html[data-theme='dark'] textarea::placeholder { color: #8780a1 !important; }
html[data-theme='dark'] .form-control:focus, html[data-theme='dark'] select:focus { border-color: #a78bfa !important; box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2) !important; }
html[data-theme='dark'] .form-control:disabled, html[data-theme='dark'] .form-control[readonly] { background-color: #1b0f36 !important; color: #a8a1c0 !important; }
html[data-theme='dark'] .select2-container--default .select2-selection__rendered,
html[data-theme='dark'] .select2-results__option { color: #f1ecff !important; }
html[data-theme='dark'] .select2-container--default .select2-results__option--highlighted[aria-selected],
html[data-theme='dark'] .select2-container--default .select2-results__option[aria-selected='true'] { background-color: #45297c !important; }
html[data-theme='dark'] .select2-container--default .select2-selection--multiple .select2-selection__choice { background-color: #45297c !important; border-color: #5b3aa0 !important; color: #fff !important; }

/* Tables */
html[data-theme='dark'] .table { color: #e6e0f5 !important; --bs-table-bg: transparent; --bs-table-striped-bg: #20123d; --bs-table-hover-bg: #23143f; --bs-table-color: #e6e0f5; --bs-table-striped-color: #e6e0f5; }
html[data-theme='dark'] .table th, html[data-theme='dark'] .table td, html[data-theme='dark'] .table thead th {
    background-color: transparent !important;
    color: #e6e0f5 !important;
    border-color: #2f2350 !important;
}
html[data-theme='dark'] .table thead th { background-color: #20123d !important; color: #cfc6ea !important; }
html[data-theme='dark'] .table-striped > tbody > tr:nth-of-type(odd) > * { background-color: #20123d !important; }

/* Buttons and small parts */
html[data-theme='dark'] .btn-light, html[data-theme='dark'] .btn-outline-secondary { background-color: #23143f !important; border-color: #40305f !important; color: #e6e0f5 !important; }
html[data-theme='dark'] .btn-outline-primary { color: #c4b5fd !important; border-color: #5b3aa0 !important; background: transparent !important; }
html[data-theme='dark'] .btn-outline-primary:hover { background: #45297c !important; color: #fff !important; }
html[data-theme='dark'] .dropdown-item { color: #e6e0f5 !important; }
html[data-theme='dark'] .dropdown-item:hover, html[data-theme='dark'] .list-group-item-action:hover { background-color: #23143f !important; color: #fff !important; }
html[data-theme='dark'] .list-group-item.active { background-color: #6d28d9 !important; border-color: #6d28d9 !important; color: #fff !important; }
html[data-theme='dark'] .breadcrumb-item a, html[data-theme='dark'] .breadcrumb-item { color: #c4b5fd !important; }
html[data-theme='dark'] .page-link { background-color: #1b0f36 !important; border-color: #2f2350 !important; color: #c4b5fd !important; }
html[data-theme='dark'] .page-item.active .page-link { background-color: #7c3aed !important; color: #fff !important; }
html[data-theme='dark'] .alert-secondary, html[data-theme='dark'] .alert-info { background-color: #23143f !important; border-color: #40305f !important; color: #e6e0f5 !important; }
html[data-theme='dark'] .alert-warning { background-color: #3b2a07 !important; border-color: #6b4d0d !important; color: #fde68a !important; }
html[data-theme='dark'] .modal-header, html[data-theme='dark'] .modal-footer, html[data-theme='dark'] hr { border-color: #2f2350 !important; }
html[data-theme='dark'] .btn-close { filter: invert(1); }
html[data-theme='dark'] .chat-message .bg-light { background-color: #23143f !important; color: #f1ecff !important; }
html[data-theme='dark'] .wd-chat-empty p, html[data-theme='dark'] .wd-cand__role, html[data-theme='dark'] .wd-cand__meta { color: #a8a1c0 !important; }
html[data-theme='dark'] .wd-cand__name { color: #f1ecff !important; }
html[data-theme='dark'] .wd-cand__chip, html[data-theme='dark'] .wd-gate__option:has(input:checked) { background: #2f1c57 !important; color: #ddd6fe !important; }
html[data-theme='dark'] .wd-gate__option { border-color: #40305f !important; }
html[data-theme='dark'] .wd-steps__item { color: #a8a1c0; }
html[data-theme='dark'] .wd-steps__item.is-current { color: #f1ecff; }
html[data-theme='dark'] .wd-steps__item::before { background: #2f2350; }

/* The logo is dark ink: show it in white on dark surfaces. */
html[data-theme='dark'] .nav-header img, html[data-theme='dark'] .brand-logo img { filter: brightness(0) invert(1); }

/* Theme toggle button in the top bar */
.wd-theme-toggle { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border: 0; }
.wd-theme-toggle .wd-theme-toggle__sun, html[data-theme='dark'] .wd-theme-toggle .wd-theme-toggle__moon { display: none; }
html[data-theme='dark'] .wd-theme-toggle .wd-theme-toggle__sun { display: inline; }

/* Template surfaces painted with a light gradient image: drop the image so the dark colour shows. */
html[data-theme='dark'] .card-header, html[data-theme='dark'] .card-footer, html[data-theme='dark'] .card,
html[data-theme='dark'] .page-titles, html[data-theme='dark'] .header, html[data-theme='dark'] .nav-header,
html[data-theme='dark'] .quixnav, html[data-theme='dark'] .modal-content, html[data-theme='dark'] .dropdown-menu {
    background-image: none !important;
}
html[data-theme='dark'] .card-header .card-title, html[data-theme='dark'] .card-header h4 { color: #f1ecff !important; }
html[data-theme='dark'] input[type='file']::file-selector-button { background-color: #2f1c57 !important; color: #f1ecff !important; border-color: #40305f !important; }
html[data-theme='dark'] .wd-steps__item.is-current span::before, html[data-theme='dark'] .wd-steps__item.is-done span::before { background-color: #7c3aed !important; color: #fff !important; }
html[data-theme='dark'] .badge.bg-light, html[data-theme='dark'] .badge-light { background-color: #2f1c57 !important; color: #ddd6fe !important; }

/* More Bootstrap pieces used across the public, job-seeker and dashboard pages */
html[data-theme='dark'] .btn-white, html[data-theme='dark'] .btn-outline-dark, html[data-theme='dark'] .btn-secondary,
html[data-theme='dark'] .btn-default { background-color: #23143f !important; border-color: #40305f !important; color: #e6e0f5 !important; }
html[data-theme='dark'] .nav-tabs, html[data-theme='dark'] .nav-tabs .nav-link { border-color: #2f2350 !important; }
html[data-theme='dark'] .nav-tabs .nav-link, html[data-theme='dark'] .nav-pills .nav-link { color: #cfc6ea !important; }
html[data-theme='dark'] .nav-tabs .nav-link.active { background-color: #23143f !important; color: #fff !important; border-color: #40305f !important; }
html[data-theme='dark'] .nav-pills .nav-link.active { background-color: #7c3aed !important; color: #fff !important; }
html[data-theme='dark'] .border, html[data-theme='dark'] .border-top, html[data-theme='dark'] .border-bottom,
html[data-theme='dark'] .border-start, html[data-theme='dark'] .border-end { border-color: #2f2350 !important; }
html[data-theme='dark'] .shadow, html[data-theme='dark'] .shadow-sm { box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important; }
html[data-theme='dark'] .progress { background-color: #2f2350 !important; }
html[data-theme='dark'] .form-check-input:not(:checked) { background-color: #23143f !important; border-color: #5b3aa0 !important; }
html[data-theme='dark'] .swal2-popup { background: #1b0f36 !important; color: #f1ecff !important; }
html[data-theme='dark'] .swal2-title, html[data-theme='dark'] .swal2-html-container { color: #f1ecff !important; }
html[data-theme='dark'] .toast, html[data-theme='dark'] .tooltip-inner { background-color: #23143f !important; color: #f1ecff !important; }
html[data-theme='dark'] pre, html[data-theme='dark'] code { background-color: #23143f !important; color: #ddd6fe !important; }
html[data-theme='dark'] .apexcharts-text, html[data-theme='dark'] .apexcharts-legend-text { fill: #cfc6ea !important; color: #cfc6ea !important; }
html[data-theme='dark'] .apexcharts-gridline { stroke: #2f2350 !important; }
html[data-theme='dark'] .apexcharts-tooltip, html[data-theme='dark'] .apexcharts-menu { background: #1b0f36 !important; color: #f1ecff !important; border-color: #2f2350 !important; }
html[data-theme='dark'] .ql-toolbar, html[data-theme='dark'] .ql-container, html[data-theme='dark'] .tox, html[data-theme='dark'] .ck.ck-editor__main > .ck-editor__editable { background: #23143f !important; color: #f1ecff !important; border-color: #40305f !important; }
html[data-theme='dark'] ::-webkit-scrollbar-thumb { background: #45297c; border-radius: 8px; }
html[data-theme='dark'] ::-webkit-scrollbar-track { background: #150a2b; }
html[data-theme='dark'] input[switch] + label { background-color: #40305f !important; }
html[data-theme='dark'] input[switch]:checked + label { background-color: #10b981 !important; }
