/* ============================================================
   XM-3 Dark Mode — Slate palette
   Background: #0F172A (slate-950)
   Surface:    #1E293B (slate-800)
   Elevated:   #334155 (slate-700)
   Border:     #334155 / #475569
   Text:       #F1F5F9 / #CBD5E1 / #94A3B8
   Accent:     #60A5FA (blue-400)
   ============================================================ */

/* --- Base --- */
body,
body header#header {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
  border-bottom: none;
}

#wrapper {
  background: #0F172A !important;
}

/* --- Header & Navigation --- */
#header {
  background: #1E293B !important;
  border-bottom: 1px solid #334155 !important;
  color: #F1F5F9;
}

#header *,
#PageTitle,
.right-holder i,
.page-head h1,
.page-head h1 a.opener,
.page-head .breadcrumbs ul li a,
.page-head .breadcrumbs ul li {
  color: #F1F5F9;
}

#nav .nav-opener-holder:before,
#nav .nav-opener-holder:after,
#nav .nav-opener-holder span,
.site-search .icon-search {
  background-color: #CBD5E1;
}

label.icon-search {
  background-color: #334155 !important;
}

/* --- Page Head --- */
section.page-head {
  background-color: #1E293B !important;
}

/* --- Sidebar / Slider Nav --- */
.slider,
ul.main_nav,
ul.accordion {
  background-color: #1E293B !important;
}

ul.main_nav {
  border: none;
}

.main_nav > li > a {
  border: none !important;
  color: #CBD5E1 !important;
}

.main_nav > li > a:hover {
  background-color: #334155 !important;
  color: #F1F5F9 !important;
}

a.opener {
  background-color: #1E293B !important;
  border: none;
  color: #F1F5F9 !important;
}

li.sub-menu {
  background-color: #1E293B !important;
}

li.sub-menu.second {
  border-bottom: 1px solid #334155;
}

.second.sub-menu .sub-link:before,
.second.sub-menu .sub-link:after {
  background: #CBD5E1 !important;
}

ul.custom-accordion {
  background-color: #1E293B !important;
}

/* --- Navbar Category --- */
nav.navbar_category {
  background-color: #0F172A !important;
}

.navbar_category .slideset {
  border-top: 1px solid #334155;
  border-bottom: 1px solid #334155 !important;
  background-color: #0F172A !important;
}

.navbar_category .slideset > ul {
  background-color: #0F172A;
}

.navbar_category .slideset > ul > li {
  border: none !important;
  background-color: #0F172A !important;
}

.navbar_category .slideset > ul > li a {
  background-color: #1E293B !important;
  color: #CBD5E1 !important;
  font-size: 12px;
  text-transform: uppercase;
}

.navbar_category .slideset > ul > li a:hover {
  background-color: #334155 !important;
  color: #F1F5F9 !important;
}

/* --- Content Panels & Cards --- */
.reports-block,
.reports-block .frame_container {
  background: #1E293B;
  color: #F1F5F9;
  border: 1px solid #334155;
  border-radius: 6px;
}

.reports-block h2,
.reports-block .frame_container ul li a {
  color: #F1F5F9;
}

.reports-block .frame_container ul li:after {
  background: #334155;
}

.head h1, .head h2, .head h3 {
  color: #F1F5F9;
}

.head {
  border-bottom: none;
}

/* --- Bootstrap Panels --- */
.panel {
  border-color: #334155;
  background: #1E293B;
}

.panel-default {
  border-color: #334155;
}

.panel-default > .panel-heading,
body .panel-default > .panel-heading,
body .panel-default > .panel-heading td {
  background-color: #1E293B;
  color: #F1F5F9;
  border-color: #334155 !important;
}

.panel-body {
  background-color: #1E293B;
  color: #F1F5F9;
  border: none;
}

.panel-title {
  color: #F1F5F9 !important;
}

/* --- List Groups --- */
ul.list-group {
  background-color: #1E293B;
}

li.list-group-item,
li.list-group-item.NoWrap {
  background-color: #1E293B !important;
  color: #F1F5F9;
  border-color: #334155;
}

.panel > .list-group .list-group-item,
.panel > .panel-collapse > .list-group .list-group-item {
  border: 1px solid #334155;
}

span.pull-right {
  color: #CBD5E1 !important;
}

.label-default {
  background-color: #334155;
}

/* --- Tables --- */
table.TableGrid.table.table-bordered.table-striped {
  background-color: #1E293B !important;
  border: 1px solid #334155;
}

.table-striped > tbody > tr:nth-of-type(odd) {
  background-color: #0F172A !important;
}

.TableGrid tbody tr td {
  border-color: #334155;
  color: #F1F5F9;
}

td.Wrap {
  color: #F1F5F9 !important;
}

.account_info th,
.account_info td {
  background-color: #1E293B;
  color: #F1F5F9;
  border: 1px solid #334155 !important;
}

.account_info th:hover {
  background: #334155 !important;
}

/* --- Forms --- */
label {
  color: #CBD5E1 !important;
}

/* Form inputs — scoped to avoid overriding portal-specific inputs */
.XMFormRow input,
.XMFormRow select,
.XMFormRow textarea,
.control_panel input,
.control_panel select,
.control_panel textarea,
.panel-body input,
.panel-body select,
.panel-body textarea,
form#DynamicForm input,
form#DynamicForm select,
form#DynamicForm textarea {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
  border-color: #475569;
}

.XMFormRow input:focus,
.XMFormRow select:focus,
.XMFormRow textarea:focus,
form#DynamicForm input:focus,
form#DynamicForm select:focus,
form#DynamicForm textarea:focus {
  background-color: #172554 !important;
  color: #F1F5F9 !important;
}

select option {
  background: #1E293B !important;
  color: #F1F5F9;
}

.row.xmFormButtonBar {
  background-color: #1E293B;
  color: #F1F5F9;
  border: none;
}

.XMFormRow {
  border-bottom: 1px solid #334155;
}

.XMFormRowChild:focus-within {
  background: #172554 !important;
  box-shadow: none;
}

.XMFormRowChild:not(.table-bordered tr) {
  border-left: none !important;
}

/* --- Form Sections --- */
div#Section,
div#Sectiontagging {
  border: 1px solid #334155 !important;
  border-radius: 6px !important;
}

/* --- Dropdowns & Popovers --- */
.xm-drop-box .xm-drop .xm-drop-frame:after,
.xm-edit .xm-drop .xm-drop-frame:after {
  border-bottom: 10px solid #1E293B;
}

.xm-drop-box .xm-drop .xm-drop-frame:before,
.xm-edit .xm-drop .xm-drop-frame:before {
  border: 1px solid #334155 !important;
}

.xm-drop-box .xm-drop .xm-drop-frame,
.xm-edit .xm-drop .xm-drop-frame {
  padding: 0 !important;
}

.xm-drop-frame {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.xm-drop-box .xm-drop a {
  border: 1px solid #475569 !important;
  color: #F1F5F9 !important;
  background: #1E293B;
}

.xm-drop-box .xm-drop a:hover {
  border: 1px solid #334155 !important;
  color: #F1F5F9 !important;
  background-color: #334155;
}

.xm-drop-box .xm-drop a.add-new:before,
.xm-drop-box .xm-drop a.add-new:after {
  background: #CBD5E1;
}

ul#AddNewMenuGroup {
  background-color: #1E293B;
  color: #F1F5F9 !important;
}

.custom-drop {
  color: #F1F5F9 !important;
  background-color: #1E293B !important;
}

.custom-drop ul {
  border: 1px solid #334155 !important;
}

/* --- Select2 --- */
.select2-container--bootstrap .select2-results__option[aria-selected="true"] {
  background-color: #2563EB !important;
  color: #fff;
}

span.select2-results {
  background-color: #1E293B !important;
}

.select2-container--bootstrap .select2-selection__clear {
  color: #94A3B8 !important;
}

/* --- Buttons --- */
.btn-gray,
.btn-gray:active,
.btn-gray.active:hover,
.btn-gray.active:focus {
  background-color: #334155 !important;
  border: 1px solid #475569 !important;
  color: #F1F5F9 !important;
  padding: 5px 20px !important;
}

.btn-gray:active:hover,
.btn-gray:active:focus {
  background-color: #1E293B !important;
}

a.btn-close {
  border: none !important;
}

/* --- Control Panel / Tabs --- */
.control_panel,
.control_panel .accordion,
.control_panel .accordion li {
  border: none !important;
  background: #1E293B;
}

.control_panel .accordion li > a {
  color: #CBD5E1 !important;
  border: none !important;
}

.control_panel .accordion li > a i {
  color: #CBD5E1;
}

.control_panel .form_row {
  border: 1px solid #334155;
}

.control_panel .tabset li a {
  color: #CBD5E1 !important;
}

.control_panel .tabset li a.active {
  background-color: #334155 !important;
  color: #F1F5F9;
}

.control_panel_slider {
  border: 1px solid #334155 !important;
}

ul#ControlBarTabs {
  background-color: #1E293B;
  border-radius: 0 0 6px 6px;
}

.tab-content.jcf-scrollable,
div#tab2 {
  background-color: #1E293B !important;
}

/* --- Icons (global) --- */
i {
  color: #CBD5E1 !important;
  border: none !important;
}

/* Override for colored brand icons */
.fa-solid.text-success,
.fa-solid.text-danger,
.fa-solid.text-warning,
.fa-solid.text-primary {
  color: inherit !important;
}

/* --- Links --- */
a.mail {
  color: #60A5FA !important;
}

span.position {
  color: #94A3B8 !important;
}

#tab1 > div > div.text-holder > a:nth-child(1) > h2 {
  color: #60A5FA !important;
}

/* --- Profile --- */
.profile {
  background-color: #1E293B;
}

/* --- Footer --- */
.footer_bottom {
  background-color: #0F172A !important;
}

footer#footer {
  background-color: #1E293B !important;
  color: #CBD5E1 !important;
}

/* --- Misc / UI Elements --- */
.ui-switcher {
  background-color: #475569 !important;
}

.pq-grid-row {
  background: #1E293B !important;
  color: #F1F5F9 !important;
}

.pq-theme .ui-state-default,
.pq-theme .ui-button,
div.pq-theme,
.search-filter-bar {
  background: #1E293B !important;
  color: #F1F5F9 !important;
}

/* --- Signature --- */
.sigWrapper {
  border: 1px solid #334155;
}

/* --- Tags --- */
ul.tagit input[type="text"] {
  background-color: #0F172A !important;
  color: #F1F5F9 !important;
}

/* --- Scrollbars (Webkit) --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0F172A;
}

::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #64748B;
}
