
  /* Global styles */
  html, body {
    height: 100%;
    margin: 0;
    padding: 0;
  }

  /* Main layout */
  .main-container {
    display: flex;
    height: calc(100vh - 56px); /* subtracting navbar height */;
    transition: all 0.3s ease;
    min-height: 100vh;
  }

  /* Sidebar */
  .sidebar {
    width: 250px; /* unified size */
    border-right: 1px solid #dee2e6;
    padding: 1rem;
    overflow-y: auto;
    position: relative;
    transition: all 0.3s ease;
    min-height: 100vh;
    flex-shrink: 0;
    }

  /* Sidebar toggle button placement */
  #sidebarToggle {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1000;
  }

  /* Hidden sidebar state */
  .sidebar-hidden .sidebar {
    display: none;
  }

  .sidebar-hidden .content {
    width: 100%;
  }
  
   #toggleSidebarBtn {
    order: 1;
  }

  .navbar-toggler {
    order: 2;
  }

  @media (max-width: 767.98px) {
    #toggleSidebarBtn {
      margin-left: auto;
      margin-right: 10px;
    }
  }

  /* Content area */
/* Content area with background image */
.content {
  flex-grow: 1;
  position: relative;
  padding: 1.5rem;
  background-color: #ffffff;
  overflow-y: auto;
  z-index: 1;
  min-height: 100vh;
}

.content::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../images/bg2.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  opacity: 0.3;
  z-index: -1;
}

.main-content {
    position: relative;
    flex-grow: 1;
    padding: 1.5rem;
    background-color: #ffffff;
    overflow-y: auto;
    transition: all 0.3s ease;
    z-index: 1;
}


  /* Top navbar toggle button */
  .navbar .btn-toggle {
    margin-left: 10px;
  }

  /* Top nav item hover effect */
  .nav-link:hover {
    background-color: #2e3b2fc9;
    border-radius: 5px;
  }

  .side-link {
  display: block;
  color: #212529;
  text-decoration: none;
  transition: background-color 0.3s, color 0.3s;
}


.sidebar .side-link:hover {
  background-color: #198754 !important;
  color: white !important;
}

.side-link.active {
  background-color: #198754;
  color: #fff ;
}

.side-link:hover {
  border-radius: 50rem;
}


  /* Submenu styles */
  .submenu {
    list-style: none;
    padding-left: 0;
  }

  .submenu li {
    padding: 5px 0;
  }

  .submenu li a {
    text-decoration: none;
    color: #495057;
    cursor: pointer;
  }

  .submenu li a:hover {
    color: #0d6efd;
  }

  #submenuList a.active {
  font-weight: bold;
  color: #0d6efd;
}

#topMenu .nav-link.active {
  font-weight: bold;
  color: #ffffff;
  border-bottom: 2px solid #ffffff;
}

  /* Fix modal z-index conflict */
    .modal-backdrop.show {
      z-index: 1050;
    }
    .modal.show {
      z-index: 1060;
    }
    .main-container, .content {
      position: relative;
      z-index: 1;
      
    }
    
    
#preloader {
  overflow: hidden;
  background-image: linear-gradient(145deg, #ffffffbb 0%, #ffffffc5 0%);
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  position: fixed;
  z-index: 9999;
  color: #198754;
}

#preloader .jumper {
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  display: block;
  position: absolute;
  margin: auto;
  width: 50px;
  height: 50px;
}

#preloader .jumper > div {
  background-color: #198754;
  width: 10px;
  height: 10px;
  border-radius: 100%;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
  position: absolute;
  opacity: 0;
  width: 50px;
  height: 50px;
  -webkit-animation: jumper 1s 0s linear infinite;
  animation: jumper 1s 0s linear infinite;
}

#preloader .jumper > div:nth-child(2) {
  -webkit-animation-delay: 0.33333s;
  animation-delay: 0.33333s;
}

#preloader .jumper > div:nth-child(3) {
  -webkit-animation-delay: 0.66666s;
  animation-delay: 0.66666s;
}

@-webkit-keyframes jumper {
  0% {
    opacity: 0;
    -webkit-transform: scale(0);
    transform: scale(0);
  }
  5% {
    opacity: 1;
  }
  100% {
    -webkit-transform: scale(1);
    transform: scale(1);
    opacity: 0;
  }
}

@keyframes jumper {
  0% {
    opacity: 0;
    -webkit-transform: scale(0);
    transform: scale(0);
  }
  5% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

#customers-table td {
    white-space: nowrap; /* prevents text wrap */
}

#customers-table td.address-column, #rawmats-table td.address-column, #customers-table td.address-column, #formulation-table td.address-column,
.raw-table th.address-column {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;      
}

.raw-table td {
    white-space: normal !important;
    word-wrap: break-word;
}

/* Add clear separation lines for all cells */
.raw-table th, .raw-table td {
    border: 1px solid #333 !important;
    vertical-align: middle;
}

.sm-col{
    width: 40px !important;
    white-space: nowrap;
}

.desc-column {
    max-width: 70px !important;
    white-space: nowrap;
}

/* Make sure full width is used */
.raw-table {
    width: 100% !important;
    border-collapse: collapse !important;
}


/* Match Select2 with Bootstrap input height */
.select2-container--default .select2-selection--single {
    height: calc(2.25rem + 2px) !important; /* same as .form-control */
    padding: 0.375rem 0.75rem; /* top/bottom + left/right padding */
    border: 1px solid #ced4da; /* Bootstrap border */
    border-radius: 0.25rem; /* Bootstrap rounded */
}

/* Vertically align the text inside */
.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: calc(2.25rem) !important;
    padding-left: 0 !important;
}

/* Adjust the arrow */
.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: calc(2.25rem) !important;
}

/* Make Select2 the same height as Bootstrap inputs and center text */
.select2-container .select2-selection--single {
  height: 38px !important;                 /* match .form-control (BS 4/5 default) */
  border: 1px solid #ced4da !important;
  border-radius: .25rem !important;
  font-size: 1rem !important;
  position: relative !important;
  padding-right: 2rem !important;          /* space for arrow/clear */
  display: flex !important;
  align-items: center !important;          /* <-- vertical centering */
}

/* Center the rendered value */
.select2-container .select2-selection--single .select2-selection__rendered {
  height: 100% !important;
  display: flex !important;
  align-items: center !important;          /* <-- vertical centering */
  padding-left: .75rem !important;
  line-height: 1.5 !important;             /* avoid fixed px line-height */
}

/* Center the clear (×) and the arrow */
.select2-container .select2-selection--single .select2-selection__clear,
.select2-container .select2-selection--single .select2-selection__arrow {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

.select2-container .select2-selection--single .select2-selection__clear {
  right: 1.75rem !important;
}

.select2-container .select2-selection--single .select2-selection__arrow {
  right: .5rem !important;
}

#inactiveTable, #payrollTable td, 
#inactiveTable, #payrollTable th {
    white-space: nowrap;
    font-size: 14px;
}

select.form-control {
  appearance: auto; 
  -webkit-appearance: auto; 
  -moz-appearance: auto;    
}

select {
  background-color: #f0f0f0;
  color: #333;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.form-control {
    border-radius: 6px;
    border: 1px solid #198754;
    padding: 8px 12px;
    transition: border-color 0.3s, box-shadow 0.3s;
    font-size: 14px;
}

.form-control:focus {
    border-color: #198754;
    box-shadow: 0 0 10px rgba(49, 213, 137, 0.5);
    outline: none;
}

/* Default option background */
.form-control option {
  background-color: #d1e7dd; /* light green */
  color: #0f5132;           /* dark green text */
  font-weight: 500;
  padding: 6px 12px;
}

/* Selected option highlight (works in most browsers) */
.form-control option:checked {
  background-color: #198754; /* Bootstrap green */
  color: #fff;
}


/* Custom green radio */
.custom-radio {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #198754; /* Bootstrap green */
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease-in-out;
}

/* Checked state */
.custom-radio:checked {
  background-color: #198754;
  border-color: #198754;
}

/* White dot inside - now centered */
.custom-radio:checked::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.select2-container--bootstrap .select2-selection--single, 
.select2-container--bootstrap .select2-selection--multiple {
    border-color: #198754 !important;
}

/* Select2 focus state (mimic .form-control:focus) */
.select2-container--bootstrap .select2-selection--single:focus,
.select2-container--bootstrap .select2-selection--multiple:focus {
    border-color: #198754 !important;
    box-shadow: 0 0 10px rgba(49, 213, 137, 0.5) !important;
    outline: none !important;
}

/* Dropdown options background */
.select2-container--bootstrap .select2-results__option {
    background-color: #def5e1; 
    color: #0f5132;          
    padding: 6px 12px;
}

/* Hover effect on options */
.select2-container--bootstrap .select2-results__option--highlighted {
    background-color: #198754 !important; /* Bootstrap green */
    color: #fff !important;
}

/* Selected option in dropdown */
.select2-container--bootstrap .select2-results__option[aria-selected=true] {
    background-color: #198754 !important;
    color: #fff !important;
}

/* Selected item in the input box */
.select2-container--bootstrap .select2-selection__rendered {
    color: #0f5132;
    font-weight: 500;
}

/* Search box inside dropdown */
.select2-container--bootstrap .select2-search--dropdown .select2-search__field {
    border: 1px solid #198754;
    border-radius: .25rem;
    padding: .375rem .75rem .375rem 2rem; /* space for icon */
    font-size: .875rem;
    width: 100%;

    background-color: #fff; /* force white background */
    background-image: url('data:image/svg+xml;utf8,<svg fill="gray" height="16" viewBox="0 0 24 24" width="16" xmlns="http://www.w3.org/2000/svg"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 109.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zM10 14a4 4 0 110-8 4 4 0 010 8z"/></svg>');
    background-repeat: no-repeat;
    background-position: 8px center;
    background-size: 14px;
}


.select2-container--bootstrap .select2-search--dropdown {
  background-color: #def5e1; 
  border-top: solid 1px #198754; 
  border-left: solid 1px #198754;  
  border-right: solid 1px #198754;
  border-bottom: solid 1px #198754;     
}

/* On focus (match .form-control:focus) */
.select2-container--bootstrap .select2-search--dropdown .select2-search__field:focus {
    border-color: #198754 !important;
    box-shadow: 0 0 10px rgba(49, 213, 137, 0.5) !important;
    outline: none !important;
}
