:root {
  /* ===== BACKGROUND ===== */
  --bg: #f8f9fc;
  --bg-secondary: #f1f3f5;
  --bg-hover: #e9ecef;
  --bg-active: #dee2e6;
  --bg-light: #e9ecef;
  --bg-overlay: #ffffffcc;

  /* ===== TEXT ===== */
  --text-primary: #343a40;
  --text-secondary: #495057;
  --text-muted: #6c757d;
  --text-disabled: #adb5bd;

  /* ===== HEADER / FOOTER ===== */
  --header-bg: #00457c;
  --header-text: #ffffff;

  --footer-bg: #f1f3f5;
  --footer-text: #495057;

  --main-bg: #ffffff;
  --page-bg: #f8f9fc;

  /* ===== BORDER ===== */
  --border: #dee2e6;
  --border-light: #e9ecef;
  --border-strong: #ced4da;

  /* ===== PRIMARY ===== */
  --primary: #00457c;
  --primary-hover: #00365f;
  --primary-active: #002a4a;
  --primary-text: #002752;
  --primary-bg: #00457c33;
  --primary-border: #00457c;

  /* ===== STATUS ===== */
  --success-text: #155724;
  --success: #28a745;
  --success-strong: #1e7e34;
  --success-bg: #28a74533;

  --warning: #ffc107;
  --warning-text: #856404;
  --warning-strong: #e0a800;
  --warning-bg: #ffc10733;

  --error: #dc3545;
  --error-bg: #dc354533;
  --error-text: #721c24;
  --danger-text: #721c24;
  --danger: #c82333;
  --danger-bg: #c8233333;

  --info: #00457c;

  /* ===== SPECIAL ===== */
  --accent-purple: #cb6bb2;
  --orange: #fd7e14;
  --pending: #00e1d7;

  /* ===== LINK ===== */
  --link: #00457c;
  --link-hover: #00365f;

  /* ===== CARD ===== */
  --card-header-bg: #e9ecef;
  --card-header-text: #343a40;
  --card-header-hover: #dee2e6;
  --card-header-border: #ced4da;
  --card-bg: #ffffff;
  --card-border: #e3e6f0;
  --card-hover: #f1f3f5;

  /* ===== ACCORDION ===== */
  --accordion-bg: #f8f9fc;
  --accordion-border: #dee2e6;
  --accordion-hover: #e9ecef;

  /* ===== TOOLTIP ===== */
  --tooltip-bg: #ffffff;
  --tooltip-border: #dee2e6;

  /* ===== BUTTON ===== */
  --btn-bg: var(--primary);
  --btn-hover: var(--primary-hover);
  --btn-active: var(--primary-active);
  --btn-disabled-bg: #e9ecef;
  --btn-disabled-text: #adb5bd;
  --btn-disabled-border: #dee2e6;

  /* ===== ICON ===== */
  --icon: #495057;

  /* ===== SHADOW ===== */
  --shadow: rgba(0, 0, 0, 0.08);

  /* ===== SIDEBAR LIGHT (DX + YOUR PRIMARY) ===== */
  --sidebar-bg: #ffffff;
  --sidebar-hover: #f5f7fa;
  --sidebar-active: #e9ecef;

  --sidebar-text: #2c3034;
  --sidebar-text-muted: #6c757d;

  --sidebar-icon: #00457c;           /* your primary */
  --sidebar-active-text: #00457c;    /* accent */
  --sidebar-border: #e3e6f0;

  /* Optional enhancements */
  --sidebar-active-bg: #00457c14;    /* soft highlight */
  --sidebar-hover-text: #000000;
  --scrollbar-track: #ffffff;   /* same as sidebar bg */
  --scrollbar-thumb: #c1c9d2;   /* soft grey */
  --scrollbar-thumb-hover: #9aa5b1;

  /* Tick colors */
  --tick-major: #8a817c;
  --tick-minor: #afaea5;
  /* ===== RANGE ===== */
  --range-success: #b7e4c7;
  --range-warning: #ffe69c;

  --chip-bg: #e9ecef;
  --chip-text: #343a40;
  --chip-border: #ced4da;

  --expired-bg: #ffdede;
  
  --black: #000;
  --black-bg: #00000033;
  --white: #fff;
  --disabled-opacity: 0.6;
}

[data-theme="dark"] {
  /* ===== BACKGROUND ===== */
  --bg: #2a2a2a;
  --bg-secondary: #333333;
  --bg-hover: #3a3a3a;
  --bg-active: #444444;
  --bg-light: #4a4a4a;
  --bg-overlay: #2a2a2abf;

  /* ===== TEXT ===== */
  --text-primary: #dedede;
  --text-secondary: #bfbfbf;
  --text-muted: #8c8c8c;
  --text-disabled: #5f6368;

  /* ===== HEADER / FOOTER ===== */
  --header-bg: #1f1f1f;
  --header-text: #ffffff;

  --footer-bg: #1f1f1f;
  --footer-text: #bfbfbf;

  --main-bg: #2a2a2a;
  --page-bg: #262626;

  /* ===== BORDER ===== */
  --border: #3a3a3a;
  --border-light: #4a4a4a;
  --border-strong: #5a5a5a;

  /* ===== PRIMARY ===== */
  --primary: #1ca8dd;
  --primary-hover: #3db9e6;
  --primary-active: #1593c3;
  --primary-text: #a5d8ff;
  --primary-bg: #1ca8dd33;
  --primary-border: #1ca8dd;

  /* ===== STATUS ===== */
  --success-text: #8ce99a;
  --success: #40c057;
  --success-strong: #2f9e44;
  --success-bg: #40c05733;

  --warning-text: #ffe066;
  --warning: #ffd43b;
  --warning-strong: #fab005;
  --warning-bg: #ffd43b33;

  --error: #ff6b6b;
  --error-bg: #ff6b6b33;
  --error-text: #ffa8a8;
  --danger-text: #ff8787;
  --danger: #fa5252;
  --danger-bg: #fa525233;

  --info: #1ca8dd;

  /* ===== SPECIAL ===== */
  --accent-purple: #d291bc;
  --orange: #ffa94d;
  --pending: #00bfb3;

  /* ===== LINK ===== */
  --link: #1ca8dd;
  --link-hover: #3db9e6;

  /* ===== CARD ===== */
  --card-header-bg: #3a3a3a;
  --card-header-text: #ffffff;
  --card-header-hover: #4a4a4a;
  --card-header-border: #5a5a5a;
  --card-bg: #333333;
  --card-border: #3a3a3a;
  --card-hover: #3a3a3a;

  /* ===== ACCORDION ===== */
  --accordion-bg: #333333;
  --accordion-border: #4a4a4a;
  --accordion-hover: #3a3a3a;

  /* ===== TOOLTIP ===== */
  --tooltip-bg: #3a3a3a;
  --tooltip-border: #4a4a4a;

  /* ===== BUTTON ===== */
  --btn-bg: var(--primary);
  --btn-hover: var(--primary-hover);
  --btn-active: var(--primary-active);
  --btn-disabled-bg: #3a3a3a;
  --btn-disabled-text: #6c757d;
  --btn-disabled-border: #4a4a4a;

  /* ===== ICON ===== */
  --icon: #d1d1d1;

  /* ===== SHADOW ===== */
  --shadow: rgba(0, 0, 0, 0.4);

  /* ===== SIDEBAR DARK (DX + YOUR PRIMARY) ===== */
  --sidebar-bg: #1f1f1f;
  --sidebar-hover: #2a2a2a;
  --sidebar-active: #262f36;

  --sidebar-text: #e6e6e6;
  --sidebar-text-muted: #a0a0a0;

  --sidebar-icon: #1ca8dd;           /* your primary */
  --sidebar-active-text: #1ca8dd;    /* accent */
  --sidebar-border: #2c2c2c;
  /* Optional enhancements */
  --sidebar-active-bg: #1ca8dd22;    /* soft highlight */
  --sidebar-hover-text: #ffffff;
  --scrollbar-track: #1f1f1f;   /* same as sidebar bg */
  --scrollbar-thumb: #3a3f45;   /* subtle visible */
  --scrollbar-thumb-hover: #5a6268;

  /* Tick colors */
  --tick-major: #e6dcd3;      /* visible on dark */
  --tick-minor: #e2ddd8;      /* softer */
  /* ===== RANGE ===== */
  --range-success: #2b8a3e;   /* brighter green */
  --range-warning: #c99700;

  --chip-bg: #3a3f45;
  --chip-text: #e6e6e6;
  --chip-border: #5a5a5a;

  --expired-bg: #5a1f1f;

  --black: #000;
  --black-bg: #00000033;
  --white: #fff;
  --disabled-opacity: 0.6;
}

body {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

.bg-theme {
  background-color: var(--bg-secondary) !important;
  color: var(--text-primary) !important;
}

.text-primary {
  color: var(--text-primary) !important;
}

.text-secondary {
  color: var(--text-secondary) !important;
}

.text-muted {
  color: var(--text-muted) !important;
}

.primary {
  color: var(--primary) !important;
}

.icon-color {
  color: var(--icon) !important;
}

.badge-primary {
  color: var(--white) !important;
  background-color: var(--primary-active) !important;
}

.badge-success {
  color: var(--white) !important;
  background-color: var(--success-strong) !important;
}

.badge-danger {
  color: var(--white) !important;
  background-color: var(--danger) !important;
}

.alert-primary {
  color: var(--primary-text);
  background-color: var(--primary-bg);
  border-color: var(--primary-border);
}

.alert-success {
  color: var(--success-text);
  background-color: var(--success-bg);
  border-color: var(--success-text);
}

.alert-warning {
  color: var(--warning-text);
  background-color: var(--warning-bg);
  border-color: var(--warning-text);
}

.alert-danger {
  color: var(--danger-text);
  background-color: var(--danger-bg);
  border-color: var(--danger-text);
}

/* Top-Bar and Side-Bar css */
/* Sidebar container */
.sidebar {
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
}

/* Menu item */
.sidebar .nav-link {
  color: var(--sidebar-text);
  padding: 10px 15px;
  transition: all 0.2s ease;
}

/* Hover */
.sidebar .nav-link:hover {
  background: var(--sidebar-hover) !important;
  color: var(--sidebar-hover-text) !important;
}
.sidebar-dark .nav-item .nav-link[data-toggle="collapse"]:hover::after {
  color: var(--sidebar-hover-text) !important;
}

/* Active */
.sidebar .nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 600;
}

/* Icon */
.sidebar .nav-link i {
  color: var(--sidebar-icon);
}

.sidebar .nav-item .collapse .collapse-inner {
  background-color: var(--sidebar-bg) !important;
  color: var(--sidebar-text) !important;
}

@media (min-width:768px) {
  .sidebar::-webkit-scrollbar {
    width: 6px;
  }

  .sidebar::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
  }

  .sidebar::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 6px;
  }

  .sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
  }

  .sidebar {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  }
}

.dropdown-menu {
  border: 1px solid var(--card-border) !important;
}

.dropdown-item {
  color: var(--text-primary) !important;
}

.dropdown-item:hover,
.dropdown-item:focus {
  color: var(--text-primary) !important;
  background-color: var(--bg-hover) !important;
}

.topbar .navbar-nav .nav-item .nav-link {
  color: var(--text-secondary) !important;
}

.topbar #sidebarToggleTop:hover {
  background-color: transparent !important;
}

#wrapper #content-wrapper {
  background: var(--page-bg) !important;
}

.main-wrapper {
  background: var(--page-bg) !important;
}

.card {
  color: var(--text-primary) !important;
  background-color: var(--card-bg) !important;
  border: 1px solid var(--card-border) !important;
  box-shadow: 0 .15rem 1.75rem 0 var(--shadow) !important;
}

.card-header {
  background-color: var(--card-header-bg) !important;
  border-bottom: 1px solid var(--card-header-border) !important;
  color: var(--card-header-text) !important;
}

.calenderTable {
  box-shadow: 0.5px 0.5px 5px 0px var(--shadow) !important;
}

/* start devExtreme switch css */
.custom-switch {
  padding: 0 !important;
}

.custom-switch[aria-pressed="false"] .dx-switch-container {
  background-color: #ccc !important;
  transition: background-color 0.3s ease;
  width: 50px !important;
  height: 25px !important;
  border-radius: 30px !important;
}

.custom-switch[aria-pressed="true"] .dx-switch-container {
  background-color: var(--primary) !important;
  transition: background-color 0.3s ease;
  width: 50px !important;
  height: 25px !important;
  border-radius: 30px !important;
}

.custom-switch .dx-switch-on {
  color: var(--white) !important;
}

.dx-switch-disabled .dx-switch-on {
  background-color: var(--primary) !important;
  opacity: var(--disabled-opacity);
}

.custom-switch .dx-switch-handle {
  background-color: var(--white);
}

.custom-switch .dx-switch-handle {
  width: 18px !important;
  height: 18px !important;
  border-radius: 50% !important;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.custom-switch .dx-switch-handle::before {
  content: '';
  background-color: var(--white) !important;
  border-radius: 50% !important;
  width: 100%;
  height: 100%;
  display: block;
  transition: background-color 0.3s ease;
}

.custom-switch .dx-switch-on,
.custom-switch .dx-switch-off {
  font-size: 12px;
  /* change to your desired font size */
  font-weight: 600;
  /* optional */
}
/* end devExtreme switch css */

/* start calender css */
.rdp-today:not(.rdp-outside) {
  font-weight: 600;
  color: var(--primary) !important;
}
/* end calender css */

/* start accordian css */
.dx-accordion-item {
  border: 1px solid var(--shadow) !important;
}

.dx-accordion-item .dx-accordion-item-opened {
  border: 1px solid transparent !important;
}

.dx-accordion-item .dx-accordion-item-closed {
  border: 1px solid transparent !important;
}

.dx-state.focused.dx-accordion-item {
  border: 1px solid var(--primary) !important;
}

.dx-item-content .dx-accordion-item-title {
  background-color: var(--danger) !important;
}

.dx-accordion-item-title::before {
  margin: 9px !important;
}

.dx-accordion-item-title-caption {
  display: flex;
  justify-content: center;
  text-transform: uppercase;
  font-size: 1rem;
  font-weight: bold;
  padding: 10px !important;
}
/* end accordian css */

/* start Datasheet grid css */
/* ===== CONTAINER ===== */
.dsg-container {
  background: var(--card-bg) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}

/* ===== HEADER ===== */
.dsg-header-row {
  background: var(--card-header-bg);
}

.dsg-header-cell {
  background: var(--card-header-bg) !important;
  color: var(--card-header-text) !important;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
}

/* ===== CELL ===== */
.dsg-cell {
  background: var(--main-bg) !important;
  color: var(--text-primary) !important;
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

/* Hover */
.dsg-row:hover {
  background: var(--bg-hover);
}

/* Focus */
.dsg-cell:focus-within {
  background: var(--bg-active);
}

/* Active cell */
.dsg-active-cell {
  outline: 2px solid var(--primary) !important;
  background: var(--primary-bg) !important;
}

/* Range selection */
.dsg-cell.dsg-cell-selected {
  background: var(--primary-bg) !important;
}

/* Prevent hover override */
.dsg-row:hover .dsg-cell.dsg-cell-selected {
  background: var(--primary-bg) !important;
}

/* Disabled cell */
.dsg-cell.dsg-cell-disabled {
  background: var(--bg-secondary) !important;
  color: var(--text-disabled) !important;
  opacity: 0.7;
  pointer-events: none;
}

/* Disabled row */
.dsg-row-disabled {
  opacity: var(--disabled-opacity);
}

/* Input inside cell */
.dsg-container input {
  background: transparent !important;
  color: var(--text-primary) !important;
  border: none;
  outline: none;
  width: 100%;
}

/* Focus input */
.dsg-container input:focus {
  background: var(--primary-bg);
}

.dsg-add-row {
  background: var(--bg-light);
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

.dsg-add-row:hover {
  background: var(--bg-hover);
  color: var(--primary);
}

/* SUCCESS */
.dsg-cell.success {
  background: var(--success-bg);
  color: var(--success-text);
}

/* WARNING */
.dsg-cell.warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

/* ERROR */
.dsg-cell.error {
  background: var(--error-bg);
  color: var(--error-text);
}

.dsg-container::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.dsg-container::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}

.dsg-container::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 6px;
}

.dsg-container::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

/* Firefox */
.dsg-container {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

/* Stable selector */
.dsg-cell [class*="singleValue"] {
  color: var(--text-primary) !important;
}

.dsg-cell.dsg-cell-disabled [class*="singleValue"] {
  color: var(--text-secondary) !important;
}
/* end Datasheet grid css */

/* start material and plants module popup */
.material-plant-popup .card-body {
  text-align: left;
}

.material-plant-popup .card-body label {
  width: 100%;
  float: left;
}

.material-plant-popup .card-body label strong {
  width: 40%;
  float: left;
  margin-right: 10px;
}

.material-plant-popup .card-body label p {
  width: 55%;
  float: left;
  margin: 0;
  padding: 0;
}
/* end material and plants module popup */


.list-user {
  color: var(--text-muted);
  /* Bootstrap text-muted */
  transition: color 0.2s ease;
}

/* On focus (keyboard navigation) */
.dx-list-item.dx-state-focused .list-user {
  color: #fff;
  opacity: 0.8;
}

[data-theme="dark"] .dx-list-item.dx-state-focused .list-user {
  color: #000;
  opacity: 0.7;
}

.grid-chip {
  background-color: var(--chip-bg);
  color: var(--chip-text);
  border: 1px solid var(--chip-border);
  margin: 2px;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  display: inline-block;
}

.dx-button.custom-icon-btn {
  min-width: auto;
  padding: 0;
}

.dx-button.custom-icon-btn .dx-button-content {
  padding: 0;
}

.header-icon-btn.dx-button {
  padding: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  line-height: 1 !important;
  vertical-align: middle;
}

.header-icon-btn .dx-button-content {
  padding: 0 !important;
  min-height: 0 !important;
  height: auto !important;
  display: inline-flex !important;
  align-items: center !important;
}

.header-icon-btn .dx-icon {
  margin: 0 !important;
  width: auto !important;
  height: auto !important;
}

.login-link {
  cursor: pointer;
  color: var(--link) !important;
  text-decoration: underline;
}

.login-link:hover {
  cursor: pointer;
  color: var(--link-hover) !important;
}

.sidebar-divider {
  border-top: 1px solid var(--text-muted);
}

.version-link {
  color: var(--text-muted);
}

.version-link:hover {
  text-decoration: underline;
}

.theme-switch {
  padding: 0 !important;
}

.theme-switch .dx-switch-container {
  width: 50px !important;
  height: 25px !important;
  border-radius: 30px !important;
  position: relative;
  transition: background-color 0.3s ease;
}

.theme-switch[aria-pressed="false"] .dx-switch-container {
  background-color: #ccc !important;
}

.theme-switch[aria-pressed="true"] .dx-switch-container {
  background-color: var(--primary) !important;
}

/* Handle — fully transparent, no circle, just a positioned slot for the icon */
.theme-switch .dx-switch-handle {
  width: 20px !important;
  height: 20px !important;
  background-color: transparent !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  transition: transform 0.3s ease;
  z-index: 3;
  position: relative;
}

/* Icon lives on the handle itself and moves with it */
.theme-switch .dx-switch-handle::before {
  content: "\f186"; /* faMoon - default/off state */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 13px;
  color: var(--black);
  background-color: transparent !important;
  transition: content 0.2s ease;
}

/* Swap glyph + color when switched on */
.theme-switch[aria-pressed="true"] .dx-switch-handle::before {
  content: "\f185"; /* faSun */
  color: var(--white);
}