/* ==========================
   GLOBAL ELEMENT STYLES
   ========================== */
::placeholder {
  opacity: 1;
  color: var(--bs-gray-600) !important;
}

.label-placeholder::placeholder {
  opacity: 1;
  color: var(--bs-gray-750) !important;
}

body {
  background-image: var(--user-bg);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-image 0.4s ease;
}

/* ==========================
   UTILITY CLASSES
   ========================== */
.pt-5px {
  padding-top: 5px !important;
}

.w-min {
  width: 1%;
  white-space: nowrap;
}

.w-50px {
  width: 50px;
}

.w-64px {
  width: 64px;
}

.w-72px {
  width: 72px;
}

.h-150px {
  height: 150px;
}

.h-600px {
  height: 600px;
}

.mh-185px {
  max-height: 185px;
}

.mh-400px {
  max-height: 400px;
}

.m-w-350px {
  min-width: 350px;
}

.cursor-pointer {
  cursor: pointer;
}

.aspect-ratio-1x1 {
  aspect-ratio: 1/1;
}

.isolate {
  isolation: isolate;
}

.z-1 {
  z-index: 1;
}

.z-5 {
  z-index: 5;
}

.bg-current-color-10 {
  background-color: color-mix(in srgb, currentColor, transparent 90%);
}

/* ==========================
   LAYOUT CONTAINERS
   ========================== */
#kt_app_root {
  overflow: auto;
}

.kt_gallery {
  width: 99%;
}

.breadcrumb-item {
  position: relative;
  color: var(--bs-gray-750);
}

/* ==========================
   COMPONENT STYLES
   ========================== */
/* Menu Icon */
.menu-icon {
  color: var(--kt-text-gray-800);
  transition: all 0.3s ease;
}

.menu-icon:hover {
  color: var(--kt-primary);
  transform: translateY(-3px);
}

.btn.menu-icon i {
  font-size: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar Search */
#sidebarSearchWrapper {
  position: relative;
}

#sidebarSearchIcon {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  pointer-events: none;
  z-index: 2;
  color: #b0b0be !important;
}

#sidebarSearch {
  background-color: transparent !important;
  padding-left: 2.5rem !important;
  height: 2.25rem !important;
  color: #b0b0be !important;
  border-color: #b0b0be !important;
}

#sidebarSearch:hover,
#sidebarSearch:focus,
#sidebarSearch:active {
  border-color: #b0b0be !important;
}

#sidebarSearchWrapper:hover #sidebarSearchIcon,
#sidebarSearchWrapper:focus-within #sidebarSearchIcon,
#sidebarSearch::placeholder,
#sidebarSearch:hover::placeholder,
#sidebarSearch:focus::placeholder {
  color: #b0b0be !important;
}

/* Background Preview */
#bg-scroll-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  max-width: 90vw;
  justify-content: center;
}

.bg-preview {
  width: 60px;
  height: 45px;
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  opacity: 0.5;
  transition: transform 0.3s ease, opacity 0.3s ease, border 0.3s ease;
  cursor: pointer;
  flex: 0 0 auto;
}

.bg-preview.active {
  width: 100px;
  height: 70px;
  border: 2px solid var(--bs-primary);
  transform: scale(1.2);
  opacity: 1;
  z-index: 2;
}

/* Media & Video */
.camera-video {
  width: 100%;
  max-width: 640px;
  border: 2px solid #ddd;
  border-radius: 8px;
}

.lecture-video {
  width: 100%;
  height: auto;
}

/* CKEditor */
.ck-content {
  min-height: 50px;
}

/* Nav Tabs */
.nav.nav-tabs.nav-line-tabs .nav-link {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.5rem 0.5rem 0 0;
  margin: 0 1px;
}

.nav.nav-tabs.nav-line-tabs .nav-link.active,
.nav.nav-tabs.nav-line-tabs .nav-item.show .nav-link {
  background-color: var(--bs-secondary);
  color: var(--bs-white);
}

/* Sidebar Menu Titles */
.app-sidebar .menu .menu-item .menu-link .menu-title,
.flatpickr-day {
  color: var(--bs-gray-750);
}

/* Notification Containers */
#notif-wrapper,
#notif-container,
#notif-footer {
  background-color: var(--bs-body-bg);
}

/* ==========================
   MEDIA QUERIES
   ========================== */
@media (min-width: 992px) {
  [data-kt-app-sidebar-minimize="on"][data-kt-app-sidebar-hoverable="true"] .app-sidebar:not(:hover) #sidebarSearch {
    opacity: 0;
    transition: opacity 0.3s ease !important;
  }
}

[data-kt-app-layout="dark-sidebar"] .app-sidebar .menu .menu-item .menu-link,
[data-kt-app-layout="dark-sidebar"] .app-sidebar .menu .menu-item .menu-link .menu-title {
  color: #b0b0be;
}

.menu-item.active>.menu-link {
  background-color: #2b2b40 !important;
}

.table-bordered> :not(caption)>*>* {
  border: 1px solid var(--bs-border-color) !important;
  vertical-align: middle !important;
}



.gridjs-tbody tr:last-child {
  border-bottom: 1px solid var(--bs-border-color) !important;
}

.marker-red {
  color: red !important;
}

.marker-blue {
  color: blue !important;
}

.marker-green {
  color: green !important;
}

.marker-yellow {
  color: yellow !important;
}

.marker-purple {
  color: purple !important;
}

.marker-orange {
  color: orange !important;
}

.marker-black {
  color: black !important;
}

.marker-white {
  color: white !important;
}

.marker-gray {
  color: gray !important;
}

.marker-brown {
  color: brown !important;
}

.app-container {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.app-content {
  padding-top: 0;
  padding-bottom: 0;
}

/* ==========================
   Placeholders
   ========================== */
.placeholder-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {

  /* At the start and end of the animation, the opacity is 1 */
  0%,
  100% {
    opacity: 1;
  }

  /* At the middle of the animation, the opacity is lower */
  50% {
    opacity: 0.5;
  }
}

.breadcrumb-wrapper::-webkit-scrollbar {
  height: 6px;
}

.h-btn-sm {
  height: 31px;
}

.h-btn-md {
  height: 38px;
}

.h-btn-lg {
  height: 46px;
}

.kpi-container {
  container-type: inline-size;

  .card {
    height: 100% !important;
  }
}

@container (width < 1200px) {
  .kpi-container {
    &>* {
      width: calc(100% / 2) !important;
    }
  }
}

@container (width < 562px) {
  .kpi-container {
    &>* {
      width: calc(100%) !important;
    }
  }
}

textarea.form-control,
.choices__inner,
.select2-container {
  min-width: 120px !important;
}

input.form-control {
  min-width: 60px !important;
}

input:disabled:not([type="checkbox"]),
select:disabled,
textarea:disabled,
input:read-only:not(.select2-input):not([data-choices]):not(.flatpickr-input):not([type="checkbox"]):not([type="file"]),
select:read-only:not(.select2-hidden-accessible):not([data-choices]),
textarea:read-only {
  background-color: var(--bs-gray-150) !important;
}

.choices {
  &:has(select:disabled) {
    cursor: not-allowed;
    background-color: var(--bs-gray-150) !important;

    .choices__button {
      visibility: hidden !important;
    }
  }

  &.choices--readonly {
    pointer-events: none;
    cursor: default;
    background-color: var(--bs-gray-150) !important;

    .choices__button {
      visibility: hidden !important;
    }

    .choices__input {
      display: none !important;
    }
  }
}

.gridjs-tbody {
  &:has(.gridjs-tr)>tr:not(.gridjs-tr):first-child {
    display: none;
  }
}

tr.gridjs-tr.gridjs-tr-clickable {
  td.gridjs-td * {
    cursor: pointer;
  }

  td.gridjs-td *:hover {
    color: var(--bs-primary) !important;
  }
}

.custom-file-label {
  position: absolute;
  inset: 0;
  padding: 1px 1px 1px 8.28rem;
}

.object-fit-contain {
  object-fit: contain !important;
}

.text-hover-primary,
.hover-text-primary,
.text-hover.text-primary {
  transition: color 0.2s ease;
}

.text-hover-primary:hover,
.text-hover-primary:focus,
.hover-text-primary:hover,
.hover-text-primary:focus,
.text-hover.text-primary:hover,
.text-hover.text-primary:focus {
  color: var(--bs-primary) !important;
}

.text-hover-primary:hover *,
.text-hover-primary:focus *,
.hover-text-primary:hover *,
.hover-text-primary:focus *,
.text-hover.text-primary:hover *,
.text-hover.text-primary:focus * {
  color: var(--bs-primary) !important;
}

.csv-preview-wrapper {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
}

.csv-preview-wrapper table {
  white-space: nowrap;
}

/* Grid Action Button Styles */
.grid-action-button {
  width: 50px;
  height: 50px;

}

.grid-action-label {
  white-space: nowrap;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* PDF Iframe */
.pdf-iframe {
  width: 100%;
  height: 500px;
}

/* Spreadsheets & Tables Overrides - Transparent with theme colors */
.jexcel_container,
.jexcel,
.jss,
.jss_container,
.jss_content,
.jss_worksheet,
.jexcel_content {
  background-color: transparent !important;
  border-color: rgba(128, 128, 128, 0.2) !important;
}

/* Force cells to be transparent with inherited text color */
.jexcel td,
.jexcel thead td,
.jexcel tbody td,
.jss td,
.jss thead td,
.jss_worksheet td,
.jss_worksheet thead td,
.jss_worksheet tbody td {
  background-color: transparent !important;
  color: inherit !important;
  border: 1px solid rgba(128, 128, 128, 0.2) !important;
}

/* Force inputs and textareas to be transparent */
.jexcel td input,
.jexcel td textarea,
.jexcel td select,
.jss td input,
.jss td textarea,
.jss td select,
.jss_worksheet td input,
.jss_worksheet td textarea,
.jss_worksheet td select {
  background-color: transparent !important;
  color: inherit !important;
}

/* Row numbers and column headers with subtle background */
.jexcel tbody td:first-child,
.jss tbody td:first-child,
.jss_worksheet tbody td:first-child,
.jexcel thead td:first-child,
.jss thead td:first-child,
.jss_worksheet thead td:first-child {
  background-color: rgba(128, 128, 128, 0.1) !important;
  color: inherit !important;
}

.jexcel thead td,
.jss thead td,
.jss_worksheet thead td {
  background-color: rgba(128, 128, 128, 0.1) !important;
  color: inherit !important;
  font-weight: 600 !important;
}

/* Light mode specific - ensure black text on white */
[data-theme="light"] .jexcel td,
[data-theme="light"] .jexcel thead td,
[data-theme="light"] .jexcel tbody td,
[data-theme="light"] .jss td,
[data-theme="light"] .jss thead td,
[data-theme="light"] .jss_worksheet td,
[data-theme="light"] .jss_worksheet thead td,
[data-theme="light"] .jss_worksheet tbody td,
[data-theme="light"] .jexcel td input,
[data-theme="light"] .jexcel td textarea,
[data-theme="light"] .jss td input,
[data-theme="light"] .jss td textarea,
[data-theme="light"] .jss_worksheet td input,
[data-theme="light"] .jss_worksheet td textarea {
  color: #000000 !important;
}

/* Dark mode specific - ensure white text on dark */
[data-theme="dark"] .jexcel td,
[data-theme="dark"] .jexcel thead td,
[data-theme="dark"] .jexcel tbody td,
[data-theme="dark"] .jss td,
[data-theme="dark"] .jss thead td,
[data-theme="dark"] .jss_worksheet td,
[data-theme="dark"] .jss_worksheet thead td,
[data-theme="dark"] .jss_worksheet tbody td,
[data-theme="dark"] .jexcel td input,
[data-theme="dark"] .jexcel td textarea,
[data-theme="dark"] .jss td input,
[data-theme="dark"] .jss td textarea,
[data-theme="dark"] .jss_worksheet td input,
[data-theme="dark"] .jss_worksheet td textarea {
  color: #ffffff !important;
}

/* Context Menu (Essential for Add/Delete Row) */
.jcontextmenu {
  z-index: 10001 !important;
  background-color: #ffffff !important;
  color: #000000 !important;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
  border: 1px solid #ddd !important;
  padding: 5px 0 !important;
}

.jcontextmenu>div {
  padding: 8px 20px !important;
  color: #000000 !important;
  cursor: pointer !important;
}

.jcontextmenu>div:hover {
  background-color: #f1f1f1 !important;
}

/* Dark mode context menu */
[data-theme="dark"] .jcontextmenu {
  background-color: #1e1e2d !important;
  color: #ffffff !important;
  border: 1px solid #2b2b40 !important;
}

[data-theme="dark"] .jcontextmenu>div {
  color: #ffffff !important;
}

[data-theme="dark"] .jcontextmenu>div:hover {
  background-color: #2b2b40 !important;
}

/* Ensure spreadsheet container doesn't overflow improperly */
.csv-preview-wrapper {
  overflow: visible !important;
}

/* Choices.js Dark Mode Support */
[data-theme='dark'] .choices__inner,
[data-theme='dark'] .choices__list--dropdown {
  background-color: #1b1b29 !important;
  color: #ffffff !important;
  border-color: #323248 !important;
}

[data-theme='dark'] .choices__list--dropdown .choices__item--selectable {
  color: #ffffff !important;
}

[data-theme='dark'] .choices__item--selectable.is-highlighted {
  background-color: #2b2b40 !important;
}

[data-theme='dark'] .choices__input {
  background-color: transparent !important;
  color: #ffffff !important;
}

/* ==========================
   FLOATING CHAT
   ========================== */

/* Unread badge (rendered on the navbar "Ask AI" button) */
#chat-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #f1416c;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  pointer-events: none;
}

/* Drawer */
#chat-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 360px;
  height: 100vh;
  z-index: 1059;
  background: var(--bs-body-bg, #fff);
  border-left: 1px solid var(--bs-border-color, #e4e6ef);
  box-shadow: -4px 0 24px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

#chat-drawer.chat-open {
  transform: translateX(0);
}

/* Overlay */
#chat-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1058;
  background: rgba(0,0,0,0.35);
}

#chat-overlay.chat-open {
  display: block;
}

/* Drawer header */
.chat-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--bs-primary, #009ef7);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.chat-close-btn {
  background: none;
  border: none;
  color: #fff;
  opacity: 0.8;
  cursor: pointer;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.chat-close-btn:hover { opacity: 1; }

/* Messages area */
#chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-bubble {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
}

.chat-bubble-self {
  background: var(--bs-primary, #009ef7);
  color: #fff;
  border-bottom-right-radius: 3px;
}

.chat-bubble-other {
  background: var(--bs-gray-200, #f1f1f4);
  color: var(--bs-gray-800, #3f4254);
  border-bottom-left-radius: 3px;
}

.chat-bubble-name {
  font-size: 0.7rem;
  font-weight: 600;
  margin-bottom: 2px;
  opacity: 0.72;
}

.chat-bubble-time {
  font-size: 0.67rem;
  margin-top: 3px;
  opacity: 0.58;
  text-align: right;
}

/* Footer input */
.chat-drawer-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--bs-border-color, #e4e6ef);
  flex-shrink: 0;
}

#chat-input {
  flex: 1;
  border: 1px solid var(--bs-border-color, #e4e6ef);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 0.85rem;
  background: var(--bs-body-bg, #fff);
  color: var(--bs-body-color, #181c32);
  outline: none;
}

#chat-input:focus {
  border-color: var(--bs-primary, #009ef7);
}

#chat-send {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--bs-primary, #009ef7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
  padding: 0;
}

#chat-send:hover {
  background: var(--bs-primary-active, #0095e8);
}
[data-filter-type] > button:first-of-type, #table-actions button:first-of-type {
  background-color: #2b2b40 !important;
  color: var(--kt-primary-inverse) !important;
}

span[data-facet-value] {
    color: black;
}

/* A grid facet's value pill (the picked range, a count) sits on the facet
   button, which is #2b2b40 in both themes: keep it the light-theme grey in
   dark mode too, or bg-secondary turns dark under its black text (#237). The
   Dashboard styles its own (dashboard.css). */
[data-theme="dark"] span[data-facet-value] {
    background-color: #e4e6ef !important;
}

/* ==========================
   LOADING
   ========================== */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    visibility: hidden;
    opacity: 0;
    transition: .2s ease;
}
.loading-overlay.active {
    visibility: visible;
    opacity: 1;
}
.loading-box {
    background: white;
    padding: 40px 60px;
    border-radius: 12px;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #eee;
    border-top: 5px solid #007bff;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Colour themes (Settings > Themes, include/helpers/theme.php), from the framework template ---- */
/* A field shown on one mode's input fill whatever the current mode (e.g. the
   Website settings' light/dark logo and font color). Uses the active theme's
   Inputs fill when it sets one, else the defaults above. */
.bg-field-light {
	background-color: var(--field-bg-light, #ffffff) !important;
}
.bg-field-dark {
	background-color: var(--field-bg-dark, #1b1b29) !important;
}

/* Themes settings page: preview samples open a color popup. */
[id^="theme-preview-"] [data-theme-sample] {
	cursor: pointer;
}
/* Each preview pane carries its own data-theme; use that mode's text color
   instead of inheriting the page's (white on the light pane in dark mode). */
[id^="theme-preview-"] {
	color: var(--kt-body-color);
}
.theme-sample-popup {
	z-index: 1060;
	width: 280px;
}

/* Buttons with an icon (form footer Save/Submit, Generate): below md the icon sits on
   top of a small caption, matching the page header buttons. */
@media (max-width: 767.98px) {
	/* Button font, not a label span: Generate's text is bare. Icons keep their own size. */
	.btn.btn-stack-sm {
		flex-direction: column;
		padding-top: 0.5rem !important;
		padding-bottom: 0.5rem !important;
		font-size: 0.85rem;
		line-height: 1;
	}
	.btn.btn-stack-sm > i {
		margin-bottom: 0.25rem !important;
	}
	/* Header buttons stack icon over caption here too: drop the icon's side spacing
	   (ms-1 + the theme's icon padding) so it stays centered. */
	.btn[data-head-button] i,
	.btn.btn-stack-sm > i {
		margin-left: 0 !important;
		margin-right: 0 !important;
		padding-right: 0 !important;
	}
}
/* Themes preview: each pane is a mock page drawn from its own theme
   variables (header = Top Bar, body = Page Background). */
.theme-sample-page {
	background-color: var(--kt-app-bg-color);
	color: var(--kt-body-color);
	container-type: inline-size;
}
/* Narrow preview pane: the mini sidebar collapses to icons, like the real
   minimized sidebar, so the page content keeps its width. */
@container (max-width: 560px) {
	.theme-sample-sidebar {
		width: 52px !important;
	}
	.theme-sample-sidebar .theme-sample-label,
	.theme-sample-sidebar .sidebar-brand-on-dark,
	.theme-sample-sidebar .sidebar-brand-on-light {
		display: none !important;
	}
	.theme-sample-sidebar-logo {
		justify-content: center !important;
	}
	.theme-sample-sidebar-toggle i {
		transform: rotate(180deg);
	}
	.theme-sample-sidebar-item,
	.theme-sample-sidebar-search {
		text-align: center;
	}
	.theme-sample-sidebar-item i,
	.theme-sample-sidebar-search i {
		margin: 0 !important;
	}
}
.theme-sample-topbar {
	background-color: var(--kt-app-header-base-bg-color);
	color: var(--kt-body-color);
}
.theme-sample-card {
	background-color: var(--kt-card-bg);
	color: var(--kt-body-color);
}
/* Themes preview: mini sidebar / breadcrumb bar, drawn in the app's default
   sidebar and toolbar colors so a theme's overrides show on top. */
.theme-sample-sidebar {
	width: 150px;
	background-color: #1e1e2d;
	color: #b0b0be;
	border-color: #393945;
}
.theme-sample-sidebar-logo {
	border-bottom: 1px dashed;
	border-bottom-color: inherit;
}
.theme-sample-sidebar-item {
	color: #b0b0be;
}
.theme-sample-sidebar-item i {
	color: inherit;
}
.theme-sample-sidebar-item.is-active {
	background-color: #2b2b40;
	color: #ffffff;
}
.theme-sample-sidebar-search {
	border: 1px solid #b0b0be;
	color: #b0b0be;
	background-color: transparent;
}
.theme-sample-crumbs {
	background-color: var(--bs-light);
	color: var(--bs-gray-750);
	border: 1px solid transparent;
}
.theme-sample-crumbs [data-theme-sample="breadcrumb_link"] {
	color: var(--bs-gray-750);
}
/* Themes preview, Light Mode pane while the page is in dark mode: the app's
   light --bs-* values live only on :root (the dark ones on [data-theme="dark"]),
   so a nested data-theme="light" wouldn't reset them. Re-declare the ones the
   preview uses, and undo the page's dark-mode input fill for this pane. */
#theme-preview-light {
	--bs-gray-100: #f5f8fa;
	--bs-gray-150: #f1f4f6;
	--bs-gray-200: #eff2f5;
	--bs-gray-300: #e4e6ef;
	--bs-gray-400: #b5b5c3;
	--bs-gray-500: #a1a5b7;
	--bs-gray-600: #7e8299;
	--bs-gray-700: #5e6278;
	--bs-gray-750: #4e5266;
	--bs-gray-800: #3f4254;
	--bs-gray-900: #181c32;
	--bs-dark: #181c32;
	--bs-light: #f5f8fa;
	--bs-light-rgb: 245, 248, 250;
	--bs-secondary: #e4e6ef;
	--bs-secondary-rgb: 228, 230, 239;
	--bs-body-bg: #ffffff;
	--bs-body-bg-rgb: 255, 255, 255;
	--bs-body-color: #000000;
	--bs-body-color-rgb: 0, 0, 0;
	--bs-border-color: #eff2f5;
	--bs-heading-color: #181c32;
}
[data-theme="dark"] #theme-preview-light .form-control,
[data-theme="dark"] #theme-preview-light .form-select {
	background-color: #ffffff;
	color: var(--kt-input-color);
	border-color: var(--kt-input-border-color);
}
/* Sidebar brand: the "on dark" logo/site name shows by default; a color theme
   with a light sidebar swaps to "on light" (include/helpers/theme.php). The
   wrappers use display: contents so the logo row's layout and the sidebar's
   own minimize rules still act on the images inside. */
.sidebar-brand-on-dark {
	display: contents;
}
.sidebar-brand-on-light {
	display: none;
}
/* Themes preview: samples for the collapse button, top bar icon and a dropdown
   menu, drawn in the app's default look. */
.theme-sample-sidebar-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 0.475rem;
	background-color: var(--kt-body-bg);
	color: var(--kt-gray-500);
	box-shadow: 0 0 6px rgba(0, 0, 0, 0.15);
}
/* Drawn like the real top-bar buttons (btn-icon btn-custom btn-icon-muted:
   muted icon color, 35px, rounded). */
.theme-sample-navicon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 35px;
	height: 35px;
	border-radius: 0.475rem;
	color: var(--kt-text-muted);
}
.theme-sample-dropdown {
	background-color: var(--kt-body-bg);
	color: var(--kt-body-color);
	box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
}
/* Themes preview "Hovered row": paint it like a real listing row under the
   mouse (.table-hover). It's an odd row of a striped table, and the stripe
   rule is more specific than .table-active, so it showed the stripe color. */
.table > tbody > tr[data-theme-sample="table_hover"] > * {
	--bs-table-accent-bg: var(--bs-table-hover-bg) !important;
	color: var(--bs-table-hover-color);
}
/* Themes preview table: restore the last row's bottom border the theme strips
   from every table. */
[id^="theme-preview-"] .table-bordered tbody tr:last-child td {
	border-bottom: 1px solid var(--bs-gray-400) !important;
}

/* Counter badges (Form::countBadge()): Danger red by default; a theme's
   count badge items override per kind. */
.count-badge {
	background-color: var(--kt-danger);
	color: var(--kt-danger-inverse, #fff);
	/* A ring in the page color, so the counter stands out on any button color (light and dark). */
	box-shadow: 0 0 0 2px var(--kt-card-bg, var(--kt-body-bg, #fff));
	/* Whole-pixel circle with the digits trimmed to their visible height, so the
	   number stays centered at every zoom (fractional sizes round differently per zoom). */
	height: 18px;
	min-width: 18px;
	padding: 0 5px;
	justify-content: center;
	line-height: 1;
	text-box: trim-both cap alphabetic;
}

/* Buttons that belong together (e.g. Approve + Disapprove) stay on one line
   when their row wraps; the group itself only breaks if it can't fit. */
.btn-keep-group {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	max-width: 100%;
}

/* Themes preview: a small box that always shows a horizontal scrollbar. */
.theme-sample-scroll {
	overflow-x: scroll;
	white-space: nowrap;
	padding-bottom: 0.25rem;
}
.theme-sample-scroll > div {
	width: 200%;
}

/* Icon buttons (the form footer's and other stacked buttons): the icon gets a fixed,
   centred box, so glyphs of different widths sit centred over or beside the label. */
/* Metronic draws button icons as inline-flex (.btn i), where text-align does
   nothing: justify-content is what centres the glyph in its fixed-width box. */
.btn.btn-stack-sm > i {
	width: 1.25em;
	text-align: center;
	justify-content: center;
}

*, *:hover {
  & i[class*="fa-"] {
    color: inherit;
  }
}
/* An X/Z slip previewed on screen (Reports › X Reading, Z Reading): black on
   white like the printed paper, whatever the colour theme — the theme's own
   text colours would otherwise reach into it (white on white in dark mode). */
.slip-paper {
  background-color: #ffffff;
  border-color: #e4e6ef !important;

  &, & * {
    color: #181c32 !important;
  }

  & hr {
    border-color: #181c32;
    opacity: 0.25;
  }
}
