/* Nexus Ghost V4 - Global White Surface Theme
   Loaded last so legacy template styles cannot restore colored page backgrounds.
   Component/action colors are intentionally preserved. */

html, body {
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
}

/* Public website structural surfaces */
body,
.header,
.header.bg--dark,
.header-bottom,
.header-bottom-area,
.auth-header,
.footer,
.footer.bg-dark-two,
.breadcrumb-bg,
.section,
.section-full,
main,
article,
.page-wrapper,
.content-wrapper,
.dashboard-container,
.dashboard-inner,
.dashboard-wrapper,
.dashboard-content,
.dashboard-sidebar,
.dashboard-nav,
.dashboard-bar,
.card,
.custom--card,
.card-header,
.card-footer,
.card-header.bg--dark,
.card-header.bg-dark-two,
.bg--dark,
.bg--dark-two,
.bg-dark,
.bg-dark-two,
.bg--light,
.bg-light,
.body-bg,
.page-bg,
.section-bg,
.content-bg,
.plan-section,
.table-responsive,
.dropdown-menu,
.modal-content,
.breadcrumb,
.breadcrumb-wrapper,
.service-title,
.order-summary,
[class*="section"].bg--dark,
[class*="section"].bg-dark,
[class*="section"].bg--light,
[class*="section"].bg-light {
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
}

/* Remove legacy decorative overlays from page-level containers. */
.header::before,
.header::after,
.footer::before,
.footer::after,
.dashboard-wrapper::before,
.dashboard-wrapper::after,
.login-main::before,
.login-main::after,
.login-area::before,
.login-area::after {
    background-image: none !important;
}

/* White header/footer needs dark readable text. */
.header,
.header a,
.header .menu a,
.header .menu > li > a,
.header .header-trigger,
.header .header-trigger i,
.footer,
.footer a,
.footer p,
.footer li,
.footer .footer-links a,
.footer .footer-text,
.breadcrumb,
.breadcrumb a {
    color: #334155 !important;
}

.header .menu .active > a,
.header .menu a:hover,
.header .header-trigger:hover,
.footer a:hover,
.breadcrumb a:hover {
    color: #2563eb !important;
}

/* User/admin form controls: always white with readable dark text. */
input,
select,
textarea,
.form-control,
.form--control,
.form-select,
.custom-select,
select.form--control,
input.form--control,
textarea.form--control {
    background-color: #fff !important;
    background-image: none !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    caret-color: #111827 !important;
}

input::placeholder,
textarea::placeholder,
.form-control::placeholder,
.form--control::placeholder {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8 !important;
}

/* Admin panel structural surfaces */
body.admin,
.admin-content,
.main-content,
.body-wrapper,
.bodywrapper__inner,
.navbar-wrapper,
.navbar-wrapper.bg--dark,
.sidebar,
.sidebar.bg--dark,
.page-wrapper.default-version,
.widget-card.bg--dark,
.setupWrapper.bg--dark {
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
}

/* Admin sidebar/nav readability on white. */
.sidebar,
.sidebar__logo,
.sidebar__menu {
    color: #334155 !important;
}
.sidebar__menu .sidebar-menu-item > a,
.sidebar__menu .sidebar-menu-item > a .menu-icon,
.sidebar__menu .sidebar-menu-item > a .menu-title {
    color: #334155 !important;
}
.sidebar__menu .sidebar-menu-item > a:hover,
.sidebar__menu .sidebar-menu-item.active > a,
.sidebar__menu .sidebar-menu-item .side-menu--open {
    background: #eff6ff !important;
    color: #2563eb !important;
}
.sidebar__menu .sidebar-menu-item > a:hover .menu-icon,
.sidebar__menu .sidebar-menu-item > a:hover .menu-title,
.sidebar__menu .sidebar-menu-item.active > a .menu-icon,
.sidebar__menu .sidebar-menu-item.active > a .menu-title {
    color: #2563eb !important;
}
.navbar-wrapper,
.navbar-wrapper a,
.navbar-wrapper button,
.navbar-wrapper i,
.navbar-user__name {
    color: #334155 !important;
}

/* Preserve branded buttons/statuses instead of turning actions white. */
.btn--primary,
.btn-primary,
.cmn-btn,
.cmn--btn,
.bg--primary,
.bg--base,
.res-sidebar-open-btn,
.sidebar .res-sidebar-close-btn {
    background-image: none !important;
}
.btn--primary,
.btn-primary,
.cmn-btn,
.cmn--btn,
.bg--primary,
.bg--base {
    background-color: #2563eb !important;
    border-color: #2563eb !important;
    color: #fff !important;
}

/* Login pages are always white. */
.login-main,
.login-area,
.login-wrapper,
.login-wrapper__top,
.login-form,
.auth-wrapper,
.auth-area,
.auth-section {
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
}
.login-wrapper {
    border: 1px solid #e5e7eb !important;
    box-shadow: 0 12px 40px rgba(15, 23, 42, .10) !important;
}

/* Prevent old theme images from painting the viewport through pseudo elements. */
body::before,
body::after,
.page-wrapper::before,
.page-wrapper::after,
.content-wrapper::before,
.content-wrapper::after,
.section::before,
.section::after {
    background-image: none !important;
}


/* V4.0.1 readability correction: white surfaces with dark content text. */
html, body, body * {
    --nexus-text: #1f2937;
}
body, body.admin, .page-wrapper, .body-wrapper, .bodywrapper__inner, .main-content,
.admin-content, .content-wrapper, main, article, section, .card, .card-body,
.table-responsive, .table, .table-responsive--sm, .table-responsive--md,
.table-responsive--lg, .table-responsive--xs {
    color: #1f2937 !important;
}

/* Admin data tables: values and responsive labels must never disappear on white. */
table.table--light,
table.table--light tbody,
table.table--light tbody tr,
table.table--light tbody td,
table.table--light tbody td * {
    color: #1f2937 !important;
    -webkit-text-fill-color: #1f2937 !important;
}
table.table--light thead th,
table.table--light thead th * {
    background: #ffffff !important;
    color: #1f2937 !important;
    -webkit-text-fill-color: #1f2937 !important;
}
.table-responsive--sm [data-label]::before,
.table-responsive--md [data-label]::before,
.table-responsive--lg [data-label]::before,
.table-responsive--xs [data-label]::before,
*[class*="table-responsive--"] [data-label]::before {
    color: #1f2937 !important;
    -webkit-text-fill-color: #1f2937 !important;
}

/* Common admin content text on white. */
.page-wrapper h1, .page-wrapper h2, .page-wrapper h3, .page-wrapper h4,
.page-wrapper h5, .page-wrapper h6, .page-wrapper p, .page-wrapper li,
.page-wrapper dt, .page-wrapper dd, .page-wrapper .form-label,
.page-wrapper label, .page-wrapper .text, .page-wrapper .card-title,
.page-wrapper .card-text, .page-wrapper .table, .page-wrapper .table td,
.page-wrapper .table th {
    color: #1f2937 !important;
}

/* Keep intentional action/status colors readable. */
.btn, .btn *, .badge, .badge *, .status-badge, .status-badge *,
.btn--primary, .btn-primary, .cmn-btn, .cmn--btn, .bg--primary, .bg--base,
.res-sidebar-open-btn, .res-sidebar-open-btn *, .sidebar .res-sidebar-close-btn,
.sidebar .res-sidebar-close-btn * {
    -webkit-text-fill-color: currentColor;
}
.btn--primary, .btn-primary, .cmn-btn, .cmn--btn, .bg--primary, .bg--base {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* V4 white theme: no page-level tint or decorative background can return. */
html, body, #app, .page-wrapper, .main-wrapper, .content-wrapper,
.container-fluid, .container, .body-wrapper, .bodywrapper__inner,
.main-content, .admin-content, .dashboard-wrapper, .dashboard-content,
.dashboard-inner, .section, .section-full, .section-bg, .page-bg,
.body-bg, .content-bg, .card, .card-body, .card-header, .card-footer,
.table-responsive, .modal-content, .dropdown-menu, .breadcrumb-wrapper,
.breadcrumb, .footer, .header {
    background-color: #ffffff !important;
    background-image: none !important;
}

/* Nexus Ghost V4.0.0 - final white surface enforcement
   Scope: page/system surfaces and controls. Functional/action colors are restored below. */
:root {
  --nexus-surface: #ffffff;
  --nexus-text: #1f2937;
  --nexus-border: #e5e7eb;
}

html, body {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
}

/* All major page/system surfaces */
body > *, main, header, footer, nav, aside, article, section,
.page-wrapper, .main-wrapper, .content-wrapper, .body-wrapper,
.bodywrapper__inner, .main-content, .admin-content, .content,
.container, .container-fluid, .row, .section, .section-full,
.section-bg, .page-bg, .body-bg, .content-bg,
.header, .header-bottom, .header-bottom-area, .footer,
.navbar, .navbar-wrapper, .breadcrumb, .breadcrumb-wrapper,
.dashboard-container, .dashboard-inner, .dashboard-wrapper,
.dashboard-content, .dashboard-sidebar, .dashboard-nav, .dashboard-bar,
.sidebar, .sidebar__inner, .sidebar__menu-wrapper, .sidebar__menu,
.card, .card-body, .card-header, .card-footer, .custom--card,
.table-responsive, .table-responsive--sm, .table-responsive--md,
.table-responsive--lg, .table-responsive--xl, .table-responsive--xs,
.table, .table thead, .table tbody, .table tr, .table td, .table th,
.form-group, .form-label, .form-control, .form--control, .form-select,
select, option, textarea, input,
.dropdown-menu, .dropdown-menu__body, .dropdown-menu__header,
.dropdown-menu__footer, .modal, .modal-dialog, .modal-content,
.modal-header, .modal-body, .modal-footer, .offcanvas,
.list-group, .list-group-item, .accordion, .accordion-item,
.accordion-header, .accordion-body, .tab-content, .tab-pane,
.pagination, .page-item, .page-link, .input-group,
.select2-container, .select2-dropdown, .select2-search,
.select2-results, .select2-results__options, .select2-results__option,
.datepicker, .datepicker-dropdown, .daterangepicker,
.toast, .notify, .alert, .custom--modal, .custom--modal .modal-content,
.order-summary, .service-title, .plan-section {
  background-color: #ffffff !important;
  background-image: none !important;
}

/* Remove legacy page-level decorative backgrounds/images */
html::before, html::after, body::before, body::after,
.page-wrapper::before, .page-wrapper::after,
.main-wrapper::before, .main-wrapper::after,
.content-wrapper::before, .content-wrapper::after,
.main-content::before, .main-content::after,
.section::before, .section::after,
.header::before, .header::after,
.footer::before, .footer::after,
.login-main::before, .login-main::after,
.login-area::before, .login-area::after {
  background: transparent !important;
  background-image: none !important;
}

/* Readable text on white surfaces */
body, main, header, footer, nav, aside, article, section,
.page-wrapper, .main-wrapper, .content-wrapper, .body-wrapper,
.bodywrapper__inner, .main-content, .admin-content, .content,
.card, .card-body, .card-header, .card-footer,
.table, .table td, .table th, .form-label, label,
.dropdown-menu, .dropdown-menu a, .modal-content, .modal-body,
.modal-title, .breadcrumb, .breadcrumb a, .list-group-item,
.accordion-body, .tab-content, .page-link, .select2-results__option {
  color: #1f2937 !important;
}

input, select, textarea, .form-control, .form--control, .form-select,
.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  caret-color: #111827 !important;
  border-color: #cbd5e1 !important;
}

input::placeholder, textarea::placeholder,
.form-control::placeholder, .form--control::placeholder {
  color: #94a3b8 !important;
  -webkit-text-fill-color: #94a3b8 !important;
}

/* White dropdowns/options, including JS-generated Select2 menus */
.dropdown-menu a, .dropdown-menu__item, .dropdown-menu__item a,
.select2-container--default .select2-results__option,
.select2-container--default .select2-search--dropdown .select2-search__field,
.select2-container--default .select2-selection--single .select2-selection__rendered {
  background: #ffffff !important;
  color: #1f2937 !important;
}
.dropdown-menu a:hover, .dropdown-menu__item:hover,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
  background: #f8fafc !important;
  color: #1f2937 !important;
}

/* Keep only intentional action/status surfaces colored. */
.btn--primary, .btn-primary, .cmn-btn, .cmn--btn,
.bg--primary, .bg--base, .res-sidebar-open-btn,
.sidebar .res-sidebar-close-btn {
  background-color: #2563eb !important;
  background-image: none !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

.badge, .status-badge, .badge *, .status-badge * {
  -webkit-text-fill-color: currentColor;
}

/* Admin sidebar is a white system surface in V4. */
.sidebar, .sidebar__logo, .sidebar__menu, .sidebar__menu-wrapper {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
}
.sidebar__menu .sidebar-menu-item > a,
.sidebar__menu .sidebar-menu-item > a .menu-icon,
.sidebar__menu .sidebar-menu-item > a .menu-title {
  color: #334155 !important;
}
.sidebar__menu .sidebar-menu-item > a:hover,
.sidebar__menu .sidebar-menu-item.active > a,
.sidebar__menu .sidebar-menu-item .side-menu--open {
  background: #f8fafc !important;
  color: #2563eb !important;
}
.sidebar__menu .sidebar-menu-item > a:hover .menu-icon,
.sidebar__menu .sidebar-menu-item > a:hover .menu-title,
.sidebar__menu .sidebar-menu-item.active > a .menu-icon,
.sidebar__menu .sidebar-menu-item.active > a .menu-title {
  color: #2563eb !important;
}

/* Login/auth pages */
.login-main, .login-area, .login-wrapper, .login-wrapper__top,
.login-wrapper__body, .auth-wrapper, .auth-area, .auth-section {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
}
.login-wrapper__top .title, .login-wrapper__top p,
.login-form label, .login-form .text-white {
  color: #0f172a !important;
}
.login-form .form-control, .login-form input {
  background: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
}

/* Avoid white theme affecting media/code/editor content. */
img, video, canvas, iframe, .CodeMirror, .CodeMirror * {
  background-color: revert-layer !important;
}

/* Version marker */
[data-nexus-version]::after { content: none !important; }

/* Standalone error pages are also part of the V4 white system surface. */
html, body, .error, .error.error-500, .error.error-419 {
  background: #ffffff !important;
  background-color: #ffffff !important;
  background-image: none !important;
}
.error::before, .error::after,
.error .star-glow {
  background-image: none !important;
}
.error .title, .error .description {
  color: #1f2937 !important;
}
