/*
 * Theme: Dark
 * -----------
 * Fully themes the National Intercollegiate Rodeo Association application 
 * to provide an immersive, professional, and high-quality dark mode.
 */

/* --- Kendo UI & Layout Design Tokens --- */
.theme-dark {
  /* --- Kendo Design System Global Tokens --- */
  --kendo-body-bg: #1a1d20;
  --kendo-body-text: #ffffff;
  
  --kendo-component-bg: #212529;
  --kendo-component-text: #ffffff;
  --kendo-component-border: #2d3238;
  
  --kendo-component-header-bg: #1e2229;
  --kendo-component-header-text: #ffffff;
  --kendo-component-header-border: #2d3238;
  
  --kendo-hover-bg: #343a40;
  --kendo-hover-text: #ffffff;
  --kendo-hover-border: #3f474e;
  
  --kendo-selected-bg: #007bff;
  --kendo-selected-text: #ffffff;
  --kendo-selected-border: #0069d9;

  --kendo-alt-bg: #1c2024;

  /* --- Kendo Brand Tokens --- */
  --kendo-color-primary: #007bff;
  --kendo-color-primary-hover: #0069d9;
  --kendo-color-primary-active: #0056b3;
}

/* --- Core Layout Backgrounds & Typography --- */
body.theme-dark,
.theme-dark .wrapper,
.theme-dark .content-wrapper {
  background-color: #1a1d20 !important;
  color: #ffffff;
}

/* Typography elements */
.theme-dark h1, .theme-dark h2, .theme-dark h3, .theme-dark h4, .theme-dark h5, .theme-dark h6,
.theme-dark .h1, .theme-dark .h2, .theme-dark .h3, .theme-dark .h4, .theme-dark .h5, .theme-dark .h6,
.theme-dark p, .theme-dark span, .theme-dark label, .theme-dark strong {
  color: #ffffff;
}
.theme-dark .text-muted, .theme-dark small, .theme-dark .help-block {
  color: #c2c7d0 !important;
}

/* --- Top Header & Navbar --- */
.theme-dark .main-header {
  background-color: #1e2229;
  border-bottom: 1px solid #2d3238;
  -webkit-box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2);
  box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.2);
}
.theme-dark .main-header .navbar-toggle {
  color: #ffffff;
}
.theme-dark .main-header .navbar-brand {
  color: #ffffff;
  border-right: 1px solid #2d3238;
}
.theme-dark .main-header .navbar {
  background-color: #1e2229 !important;
}
.theme-dark .main-header .navbar .nav > li > a {
  color: #ffffff !important;
}
.theme-dark .main-header .navbar .nav > li > a:hover,
.theme-dark .main-header .navbar .nav > li > a:active,
.theme-dark .main-header .navbar .nav > li > a:focus,
.theme-dark .main-header .navbar .nav .open > a,
.theme-dark .main-header .navbar .nav .open > a:hover,
.theme-dark .main-header .navbar .nav .open > a:focus,
.theme-dark .main-header .navbar .nav > .active > a {
  background-color: #1a1d20 !important;
  color: #ffffff !important;
}
.theme-dark .main-header .navbar .sidebar-toggle {
  color: #ffffff !important;
}
.theme-dark .main-header .navbar .sidebar-toggle:hover {
  color: #ffffff !important;
  background-color: #1a1d20 !important;
}
.theme-dark .main-header .navbar > .sidebar-toggle {
  color: #ffffff !important;
  border-right: 1px solid #2d3238 !important;
}
.theme-dark .main-header .navbar .navbar-nav > li > a {
  border-right: 1px solid #2d3238 !important;
}
.theme-dark .main-header .navbar .navbar-custom-menu .navbar-nav > li > a,
.theme-dark .main-header .navbar .navbar-right > li > a {
  border-left: 1px solid #2d3238 !important;
  border-right-width: 0 !important;
}
.theme-dark .main-header .logo {
  background-color: #1e2229 !important;
  color: #ffffff !important;
  border-bottom: 0 solid transparent;
  border-right: 1px solid #2d3238 !important;
}
.theme-dark .main-header .logo:hover {
  background-color: #1a1d20 !important;
}
@media (max-width: 767px) {
  .theme-dark .main-header .logo {
    background-color: #1e2229 !important;
    color: #ffffff !important;
    border-bottom: 0 solid transparent;
    border-right: none !important;
  }
  .theme-dark .main-header .logo:hover {
    background-color: #1a1d20 !important;
  }
}
.theme-dark .main-header li.user-header {
  background-color: #212529;
  border-bottom: 1px solid #2d3238;
}
.theme-dark .content-header {
  background: transparent;
  box-shadow: none;
}

/* --- Left Sidebar --- */
.theme-dark .main-sidebar,
.theme-dark .left-side {
  background-color: #1e2229 !important;
  border-right: 1px solid #2d3238;
}
.theme-dark .user-panel > .info,
.theme-dark .user-panel > .info > a {
  color: #ffffff;
}
.theme-dark .sidebar-menu > li.header {
  color: #7b838f;
  background: #181a1d;
  font-size: 0.75rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 12px 25px 12px 15px;
}
.theme-dark .sidebar-menu > li > a {
  color: #c2c7d0;
  border-left: 3px solid transparent;
  margin: 2px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}
.theme-dark .sidebar-menu > li:hover > a,
.theme-dark .sidebar-menu > li.menu-open > a {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05) !important;
}
.theme-dark .sidebar-menu > li.active > a,
.theme-dark .sidebar-menu > li.active:hover > a {
  color: #ffffff !important;
  background-color: #343a40 !important;
  border-left-color: #007bff;
}
.theme-dark .sidebar-menu > li > .treeview-menu {
  margin: 0;
  background-color: #181a1d !important;
}
.theme-dark .sidebar a {
  color: #c2c7d0;
}
.theme-dark .sidebar a:hover {
  text-decoration: none;
}
.theme-dark .sidebar-menu .treeview-menu > li > a {
  color: #c2c7d0;
  padding: 5px 5px 5px 25px;
  margin: 2px 8px;
  border-radius: 4px;
}
.theme-dark .sidebar-menu .treeview-menu > li.active > a,
.theme-dark .sidebar-menu .treeview-menu > li.active:hover > a {
  color: #ffffff !important;
  background-color: #343a40 !important; /* Solid background for selected sub-menu item */
}
.theme-dark .sidebar-menu .treeview-menu > li > a:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}
.theme-dark .sidebar-form {
  border-radius: 3px;
  border: 1px solid #2d3238;
  margin: 10px 10px;
  background-color: #1a1d20;
}
.theme-dark .sidebar-form input[type="text"],
.theme-dark .sidebar-form .btn {
  box-shadow: none;
  background-color: #1a1d20;
  border: 1px solid transparent;
  height: 35px;
  color: #ffffff;
}
.theme-dark .sidebar-form input[type="text"]:focus,
.theme-dark .sidebar-form input[type="text"]:focus + .input-group-btn .btn {
  background-color: #212529;
  color: #ffffff;
}

/* --- Bootstrap Wells, Panels, & Cards --- */
.theme-dark .well {
  background-color: #212529 !important;
  border: 1px solid #2d3238 !important;
  color: #ffffff !important;
  border-radius: 6px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}
.theme-dark .panel {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
}
.theme-dark .panel-default > .panel-heading {
  background-color: #1e2229 !important;
  color: #ffffff !important;
  border-color: #2d3238 !important;
}
.theme-dark .card {
  background-color: #212529 !important;
  border: 1px solid #2d3238 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}
.theme-dark .card-header {
  background-color: #1e2229 !important;
  border-bottom: 1px solid #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .card-footer {
  background-color: #1e2229 !important;
  border-top: 1px solid #2d3238 !important;
  color: #ffffff !important;
}

/* --- AdminLTE Box Component --- */
.theme-dark .box {
  background-color: #212529 !important;
  border-top: 3px solid #2d3238 !important;
  border-left: 1px solid #2d3238 !important;
  border-right: 1px solid #2d3238 !important;
  border-bottom: 1px solid #2d3238 !important;
  border-radius: 6px !important;
  color: #ffffff !important;
}
.theme-dark .box.box-primary {
  border-top-color: #007bff !important;
}
.theme-dark .box.box-success {
  border-top-color: #28a745 !important;
}
.theme-dark .box.box-info {
  border-top-color: #17a2b8 !important;
}
.theme-dark .box-header {
  background-color: #212529 !important;
  border-bottom: 1px solid #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .box-header.with-border {
  border-bottom: 1px solid #2d3238 !important;
}
.theme-dark .box-title {
  color: #ffffff !important;
}
.theme-dark .box-body {
  background-color: #212529 !important;
  color: #ffffff !important;
}
.theme-dark .box-body p,
.theme-dark .box-body label,
.theme-dark .box-body strong {
  color: #ffffff !important;
}

/* --- Info Box (Applications Progress) --- */
.theme-dark .info-box {
  background: #212529 !important;
  border: 1px solid #2d3238 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15) !important;
}
.theme-dark .info-box-icon {
  border-top-left-radius: 2px;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 2px;
}
.theme-dark .info-box-content {
  color: #ffffff !important;
}
.theme-dark .info-box-text {
  color: #c2c7d0 !important;
}
.theme-dark .info-box-number {
  color: #ffffff !important;
}

/* Kendo Card & Card Header overrides for parameters area */
.theme-dark .k-card {
  background-color: #2d3238 !important;
  border-color: #3f474e !important;
  color: #ffffff !important;
}
.theme-dark .k-card-header {
  background-color: #2d3238 !important;
  border-bottom: 1px solid #3f474e !important;
  color: #ffffff !important;
}
.theme-dark .k-card-title {
  color: #ffffff !important;
}

/* Kendo Chip (selected school tag) */
.theme-dark .k-chip {
  background-color: #343a40 !important;
  border-color: #3f474e !important;
  color: #ffffff !important;
}

/* Kendo Splitbar (divider between report viewer panes) */
.theme-dark .k-splitbar {
  background-color: #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .k-splitbar-horizontal {
  background-color: #2d3238 !important;
}

/* --- Form Controls & Standard Inputs --- */
.theme-dark input[type="text"],
.theme-dark input[type="password"],
.theme-dark input[type="email"],
.theme-dark input[type="number"],
.theme-dark input[type="search"],
.theme-dark input[type="tel"],
.theme-dark input[type="url"],
.theme-dark select,
.theme-dark textarea,
.theme-dark .form-control {
  background-color: #1a1d20 !important;
  color: #ffffff !important;
  border: 1px solid #343a40 !important;
}
.theme-dark input:focus,
.theme-dark select:focus,
.theme-dark textarea:focus,
.theme-dark .form-control:focus {
  background-color: #1a1d20 !important;
  color: #ffffff !important;
  border-color: #007bff !important;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
}

/* --- Layout Footer --- */
.theme-dark .main-footer {
  background-color: #1e2229 !important;
  border-top: 1px solid #2d3238 !important;
  color: #c2c7d0 !important;
}

/* --- Kendo UI Specific Refinements --- */
.theme-dark .k-widget,
.theme-dark .k-textbox,
.theme-dark .k-dropdown,
.theme-dark .k-combobox,
.theme-dark .k-numerictextbox {
  color: #ffffff !important;
}

/* Kendo input wrappers, search boxes, and dropdown pickers */
.theme-dark .k-input,
.theme-dark .k-picker,
.theme-dark .k-dropdownlist,
.theme-dark .k-searchbox {
  background-color: #1a1d20 !important;
  border-color: #343a40 !important;
  color: #ffffff !important;
}

/* Inner input and value text readability */
.theme-dark .k-input-inner,
.theme-dark .k-input-value-text,
.theme-dark .k-dropdownlist .k-input-inner {
  color: #ffffff !important;
}

/* Grid specifics */
.theme-dark .k-grid {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .k-grid-header,
.theme-dark .k-grid-header .k-header,
.theme-dark .k-grid-header .k-table-th {
  background-color: #1e2229 !important;
  border-color: #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .k-grid-header .k-link {
  color: #ffffff !important;
}
.theme-dark .k-grid td,
.theme-dark .k-grid .k-table-td {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .k-grid .k-table-alt-row > td,
.theme-dark .k-grid .k-table-alt-row > .k-table-td {
  background-color: #1c2024 !important;
}
.theme-dark .k-grid .k-table-row:hover > td,
.theme-dark .k-grid .k-table-row:hover > .k-table-td,
.theme-dark .k-grid .k-table-alt-row:hover > td,
.theme-dark .k-grid .k-table-alt-row:hover > .k-table-td {
  background-color: #2d3238 !important;
}
.theme-dark .k-grid-toolbar,
.theme-dark .k-toolbar {
  background-color: #1e2229 !important;
  border-color: #2d3238 !important;
}
.theme-dark .k-grid-pager,
.theme-dark .k-pager {
  background-color: #1e2229 !important;
  border-color: #2d3238 !important;
}
.theme-dark .k-pager-numbers .k-link {
  color: #ffffff !important;
}
.theme-dark .k-pager-numbers .k-selected {
  background-color: #007bff !important;
  border-color: #007bff !important;
  color: #ffffff !important;
}

/* Empty grid (no records) state */
.theme-dark .k-grid-content,
.theme-dark .k-grid-content-locked,
.theme-dark .k-grid-norecords,
.theme-dark .k-grid-norecords td,
.theme-dark .k-grid-norecords .k-table-td {
  background-color: #212529 !important;
  color: #ffffff !important;
}

/* Grid toolbar buttons (primary action) */
.theme-dark .k-button-solid-primary {
  background-color: #007bff !important;
  border-color: #0069d9 !important;
  color: #ffffff !important;
}
.theme-dark .k-button-solid-primary:hover {
  background-color: #0069d9 !important;
  border-color: #0056b3 !important;
  color: #ffffff !important;
}
.theme-dark .k-button-solid-primary:focus,
.theme-dark .k-button-solid-primary.k-focus {
  background-color: #0069d9 !important;
  border-color: #0056b3 !important;
  box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3) !important;
}

/* Pickers & Popups */
.theme-dark .k-popup,
.theme-dark .k-list-container,
.theme-dark .k-list {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .k-list-item {
  color: #ffffff !important;
}
.theme-dark .k-list-item:hover,
.theme-dark .k-list-item.k-hover {
  background-color: #2d3238 !important;
}
.theme-dark .k-list-item.k-selected {
  background-color: #343a40 !important;
  color: #ffffff !important;
}

/* Menu popups (export dropdown, overflow menu, etc.) */
.theme-dark .k-menu-group,
.theme-dark ul.k-context-menu.k-menu-group,
.theme-dark .k-menu-group-flat {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .k-menu-group .k-item,
.theme-dark .k-menu-group .k-menu-item {
  background-color: transparent !important;
  color: #ffffff !important;
}
.theme-dark .k-menu-group .k-menu-link {
  color: #ffffff !important;
  background-color: transparent !important;
}
.theme-dark .k-menu-group .k-menu-item:hover,
.theme-dark .k-menu-group .k-menu-item.k-hover {
  background-color: #2d3238 !important;
}

/* Calendar Popup (DatePicker, DateTimePicker, etc.) */
.theme-dark .k-animation-container .k-calendar {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .k-calendar .k-calendar-header {
  background-color: #1e2229 !important;
  color: #ffffff !important;
}
.theme-dark .k-calendar .k-calendar-header .k-button {
  background-color: transparent !important;
  color: #ffffff !important;
  border-color: transparent !important;
}
.theme-dark .k-calendar .k-calendar-header .k-button:hover {
  background-color: #2d3238 !important;
}
/* Calendar Popup Header (DatePicker inside filter menus, etc.) */
.theme-dark .k-animation-container .k-calendar .k-calendar-header {
  background-color: #1e2229 !important;
  color: #ffffff !important;
}
.theme-dark .k-animation-container .k-calendar .k-calendar-header .k-button {
  background-color: transparent !important;
  color: #ffffff !important;
  border-color: transparent !important;
}
.theme-dark .k-animation-container .k-calendar .k-calendar-header .k-button:hover {
  background-color: #2d3238 !important;
}
/* Broader fallbacks for Kendo 2026 calendar popup header (may render outside .k-animation-container) */
.theme-dark .k-popup .k-calendar .k-calendar-header {
  background-color: #1e2229 !important;
  color: #ffffff !important;
}
.theme-dark .k-popup .k-calendar .k-calendar-header .k-button {
  background-color: transparent !important;
  color: #ffffff !important;
  border-color: transparent !important;
}
.theme-dark .k-popup .k-calendar .k-calendar-header .k-button:hover {
  background-color: #2d3238 !important;
}

/* Kendo 2026 calendar uses k-header k-hstack instead of k-calendar-header */
.theme-dark .k-calendar .k-header {
  background-color: #1e2229 !important;
  color: #ffffff !important;
}
.theme-dark .k-calendar .k-header .k-button-flat {
  background-color: transparent !important;
  color: #ffffff !important;
  border-color: transparent !important;
}
.theme-dark .k-calendar .k-header .k-button-flat:hover {
  background-color: #2d3238 !important;
}
.theme-dark .k-animation-container .k-calendar .k-header {
  background-color: #1e2229 !important;
}
.theme-dark .k-animation-container .k-calendar .k-header .k-button-flat {
  background-color: transparent !important;
  color: #ffffff !important;
}
.theme-dark .k-animation-container .k-calendar .k-header .k-button-flat:hover {
  background-color: #2d3238 !important;
}
.theme-dark .k-popup .k-calendar .k-header {
  background-color: #1e2229 !important;
}
.theme-dark .k-popup .k-calendar .k-header .k-button-flat {
  background-color: transparent !important;
  color: #ffffff !important;
}
.theme-dark .k-popup .k-calendar .k-header .k-button-flat:hover {
  background-color: #2d3238 !important;
}
.theme-dark .k-calendar .k-calendar-th {
  color: #c2c7d0 !important;
  background-color: #1e2229 !important;
}
.theme-dark .k-calendar td,
.theme-dark .k-calendar .k-calendar-td {
  background-color: #212529 !important;
  color: #ffffff !important;
  border-color: transparent !important;
}
.theme-dark .k-calendar td:hover,
.theme-dark .k-calendar .k-calendar-td:hover {
  background-color: #2d3238 !important;
}
.theme-dark .k-calendar .k-selected {
  background-color: #343a40 !important;
  color: #ffffff !important;
}
.theme-dark .k-calendar .k-calendar-today {
  background-color: #2a3036 !important;
}
.theme-dark .k-calendar .k-weekend {
  background-color: #1a1d20 !important;
}
.theme-dark .k-calendar .k-other-month {
  color: #6c757d !important;
}
.theme-dark .k-calendar .k-calendar-view {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
}

/* TabStrip */
.theme-dark .k-tabstrip {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .k-tabstrip-items-wrapper,
.theme-dark .k-tabstrip-items {
  background-color: #1e2229 !important;
  border-color: #2d3238 !important;
}
.theme-dark .k-tabstrip-items .k-tabstrip-item {
  background-color: #1e2229 !important;
  border-color: #2d3238 !important;
  color: #c2c7d0 !important;
}
.theme-dark .k-tabstrip-items .k-tabstrip-item.k-hover,
.theme-dark .k-tabstrip-items .k-tabstrip-item:hover {
  color: #ffffff !important;
  background-color: #2d3238 !important;
}
.theme-dark .k-tabstrip-items .k-tabstrip-item.k-active {
  background-color: #2a3036 !important;
  border-bottom: 3px solid #007bff !important;
  color: #ffffff !important;
}
.theme-dark .k-tabstrip-items .k-tabstrip-item.k-active .k-link {
  font-weight: 600 !important;
}
.theme-dark .k-tabstrip-items .k-tabstrip-item .k-link {
  color: inherit !important;
}
.theme-dark .k-tabstrip-content,
.theme-dark .k-tabstrip > .k-content {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
  color: #ffffff !important;
}

/* Pace loading bar (if active) */
.theme-dark .pace .pace-progress {
  background: #007bff;
}
.theme-dark .pace .pace-activity {
  border-top-color: #007bff;
  border-left-color: #007bff;
}

/* --- Dark Mode Buttons --- */
/* Standard Kendo & general buttons */
.theme-dark .k-button,
.theme-dark .k-button-solid-base,
.theme-dark .btn:not(.btn-primary) {
  background-color: #2d3238 !important;
  border-color: #3f474e !important;
  color: #ffffff !important;
}

/* Hover and active states */
.theme-dark .k-button:hover,
.theme-dark .k-button-solid-base:hover,
.theme-dark .k-button.k-hover,
.theme-dark .k-button-solid-base.k-hover,
.theme-dark .btn:not(.btn-primary):hover {
  background-color: #3e444c !important;
  border-color: #4f565f !important;
  color: #ffffff !important;
}

/* Primary buttons override */
.theme-dark .k-button-solid-primary,
.theme-dark .btn-primary {
  background-color: #007bff !important;
  border-color: #0069d9 !important;
  color: #ffffff !important;
}

.theme-dark .k-button-solid-primary:hover,
.theme-dark .btn-primary:hover {
  background-color: #0069d9 !important;
  border-color: #0056b3 !important;
  color: #ffffff !important;
}

/* Link & Flat Buttons overrides to prevent solid k-button styles from corrupting transparent button layouts */
.theme-dark .k-button-link,
.theme-dark .k-button-flat {
  background-color: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.theme-dark .k-button-link-primary {
  color: #3897f0 !important; /* Elegant light blue for primary link buttons in dark mode */
}
.theme-dark .k-button-link-primary:hover,
.theme-dark .k-button-link-primary.k-hover {
  color: #60a5fa !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}

/* --- Notifications / Toasts --- */
.theme-dark .k-notification {
  background-color: #343a40 !important;
  color: #ffffff !important;
  border: 1px solid #3f474e !important;
}
.theme-dark .k-notification.k-notification-info {
  border-left: 4px solid #17a2b8 !important;
}
.theme-dark .k-notification.k-notification-success {
  border-left: 4px solid #28a745 !important;
}
.theme-dark .k-notification.k-notification-warning {
  border-left: 4px solid #ffc107 !important;
}
.theme-dark .k-notification.k-notification-error {
  border-left: 4px solid #dc3545 !important;
}

/* --- Sidebar Collapse Hover Menu Styles --- */
body.theme-dark.sidebar-mini.sidebar-collapse .sidebar-menu > li > a {
  margin: 2px 0 !important;
  border-radius: 0 !important;
}
body.theme-dark.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span:not(.pull-right):not(.pull-right-container) {
  background-color: #1e2229 !important; /* Solid dark background matching main sidebar */
  color: #ffffff !important;
  margin-left: 0 !important; /* Reset margin offset */
  border-top-right-radius: 4px;
}
body.theme-dark.sidebar-mini.sidebar-collapse .sidebar-menu > li.active:hover > a > span:not(.pull-right):not(.pull-right-container),
body.theme-dark.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a.active > span:not(.pull-right):not(.pull-right-container) {
  background-color: #343a40 !important; /* Solid active dark background for selected hover header */
  color: #ffffff !important;
  margin-left: 0 !important;
  border-top-right-radius: 4px;
}
body.theme-dark.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu {
  background-color: #181a1d !important; /* Solid dark background matching treeview menu */
  border: 1px solid #2d3238;
  border-left: none;
  border-bottom-right-radius: 4px;
  border-top-right-radius: 4px;
}

/* Position the hover popup menu exactly at left: 50px to align with the sidebar edge (no text cut-off) */
body.theme-dark.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span:not(.pull-right):not(.pull-right-container),
body.theme-dark.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu {
  left: 50px !important;
}

/* Create an invisible hover bridge tunnel to prevent premature mouseleave closing when moving the mouse across the sidebar edge */
body.theme-dark.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > a > span:not(.pull-right):not(.pull-right-container)::before,
body.theme-dark.sidebar-mini.sidebar-collapse .sidebar-menu > li:hover > .treeview-menu::before {
  content: '';
  position: absolute;
  left: -12px !important;
  top: 0;
  bottom: 0;
  width: 12px !important;
  background-color: transparent !important;
  z-index: 1000;
}

/* --- Bootstrap List Group (used in administrator edit sidebox, etc.) --- */
.theme-dark .list-group {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
}
.theme-dark .list-group-item {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .list-group-item label,
.theme-dark .list-group-item .control-label {
  color: #c2c7d0 !important;
}
.theme-dark .list-group-item span {
  color: #ffffff !important;
}
.theme-dark .list-group-item label + span,
.theme-dark .list-group-item .control-label + span {
  color: #ffffff !important;
}
.theme-dark .list-group-flush > .list-group-item {
  border-left: 0 !important;
  border-right: 0 !important;
}

/* --- Kendo Dialog (used for remove confirmation, etc.) --- */
.theme-dark .k-dialog {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .k-dialog .k-dialog-titlebar {
  background-color: #1e2229 !important;
  border-bottom: 1px solid #2d3238 !important;
  color: #ffffff !important;
}
.theme-dark .k-dialog .k-dialog-title {
  color: #ffffff !important;
}
.theme-dark .k-dialog .k-dialog-content {
  background-color: #212529 !important;
  color: #ffffff !important;
}
.theme-dark .k-dialog .k-dialog-content p {
  color: #ffffff !important;
}
.theme-dark .k-dialog .k-dialog-actions {
  background-color: #1e2229 !important;
  border-top: 1px solid #2d3238 !important;
}

/* --- Kendo Window (base overlay for popups) --- */
.theme-dark .k-window {
  background-color: #212529 !important;
  border-color: #2d3238 !important;
  color: #ffffff !important;
}

/* --- Report Viewer Dark Mode Inversion --- */
.theme-dark .trv-pages-area {
  filter: invert(1) hue-rotate(180deg);
}

/* Dark background for the parameters pane */
.theme-dark .trv-parameters-area {
  background-color: #212529 !important;
  color: #ffffff !important;
}

/* Dark background for the report content area (splitter container behind pages) */
.theme-dark .trv-content.trv-document-map-splitter {
  background-color: #212529 !important;
}
.theme-dark .trv-content.trv-parameters-splitter {
  background-color: #212529 !important;
}

/* --- Input Group Append (Identity Email Confirmed Indicator) --- */
.theme-dark .input-group-text {
  background-color: #2d3238 !important;
  color: #ffffff !important;
  border-color: #343a40 !important;
}

/* --- Identity / Account Manage Navbar --- */
/* Override Bootstrap navbar-light.bg-light to use dark theme colors */
.theme-dark .identity-nav.navbar.navbar-light.bg-light {
  background-color: #212529 !important;
}

.theme-dark .identity-nav .navbar-nav .nav-link {
  color: #adb5bd !important;
}

.theme-dark .identity-nav .navbar-nav .nav-link:hover,
.theme-dark .identity-nav .navbar-nav .nav-link:focus {
  color: #ffffff !important;
}

.theme-dark .identity-nav .navbar-nav .nav-link.active {
  color: #ffffff !important;
  background-color: #343a40;
  border-radius: 4px;
}

/* --- Bootstrap Table (Paid/Waived on Stock Fines tab, Estimated Advertising Audiences on Publicity tab) --- */
.theme-dark .table {
  background-color: #212529 !important;
  color: #ffffff !important;
  --bs-table-color: #ffffff !important;
  --bs-table-bg: #212529 !important;
  --bs-table-border-color: #2d3238 !important;
  border-color: #2d3238 !important;
}
.theme-dark .table th,
.theme-dark .table td {
  color: #ffffff !important;
  border-color: #2d3238 !important;
}
.theme-dark .table thead th {
  border-bottom-color: #2d3238 !important;
}
.theme-dark .table > :not(caption) > * > * {
  color: #ffffff !important;
  background-color: transparent !important;
  border-color: #2d3238 !important;
}

/* --- Label elements for form labels and heading labels --- */
.theme-dark label,
.theme-dark .form-label,
.theme-dark .col-form-label {
  color: #ffffff !important;
}
.theme-dark label.fs-4,
.theme-dark label.fs-5,
.theme-dark .form-label.fs-4,
.theme-dark .form-label.fs-5 {
  color: #ffffff !important;
}

/* --- Kendo Upload Widget --- */
.theme-dark .k-upload {
  background-color: #212529 !important;
  border-color: #454d55 !important;
}
.theme-dark .k-upload .k-dropzone {
  background-color: #2a3036 !important;
  color: #adb5bd !important;
  border-color: #454d55 !important;
}
.theme-dark .k-upload .k-file {
  background-color: #212529 !important;
  color: #adb5bd !important;
  border-color: #454d55 !important;
}
.theme-dark .k-upload .k-file .k-file-name {
  color: #adb5bd !important;
}
.theme-dark .k-upload .k-file .k-upload-status {
  color: #adb5bd !important;
}
.theme-dark .k-upload .k-file .k-file-validation-message {
  color: #6c757d !important;
}
.theme-dark .k-upload .k-file .k-file-size {
  color: #6c757d !important;
}
.theme-dark .k-upload .k-file .k-file-information {
  color: #adb5bd !important;
}
.theme-dark .k-upload-button {
  background-color: #343a40 !important;
  border-color: #454d55 !important;
  color: #adb5bd !important;
}
.theme-dark .k-upload-button:hover {
  background-color: #3d444c !important;
  color: #ffffff !important;
}
