/*--------------------------------------------------------------
# General
--------------------------------------------------------------*/
:root {
  scroll-behavior: smooth;
  --border-color: rgba(128, 128, 128, 0.2);
  --text-muted: #6c757d;
  --bs-offcanvas-color: var(--text-color);
  --bs-offcanvas-bg: var(--bg-color);
  --bs-offcanvas-border-color: var(--border-color);
  --bs-body-bg: var(--bg-color);
  --bs-body-secondary-bg: var(--bg-color-light);
  --bs-body-secondary-color: var(--text-color-light);
}

:root[data-theme="dark"] {
  --text-muted: #9ca3af;
}

a {
  text-decoration: none;
}


/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-color);
  color: var(--bg-color);
  border-color: var(--border-color);
  
}

/* Text color utilities */
.text-dark {
  color: var(--text-color) !important;
}

/* Override default shadow behavior */
.shadow,
.shadow-sm,
.shadow-lg {
  box-shadow: 0 0.125rem 0.25rem rgba(128, 128, 128, 0.15) !important;
}

/* Dropdown dark theme support */
.dropdown-menu {
  background-color: var(--bg-color) !important;
  border-color: var(--border-color) !important;
  color: var(--text-color) !important;
  box-shadow: 0 0.125rem 0.25rem rgba(128, 128, 128, 0.15) !important;
}

.dropdown-toggle {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
}

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

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

.dropdown-divider {
  border-top-color: var(--border-color) !important;
}

/* Pagination dark theme support */
.page-link {
  background-color: var(--bg-color) !important;
  border-color: var(--border-color) !important;
  color: var(--text-color) !important;
}

.page-link:hover {
  background-color: var(--text-color) !important;
  border-color: var(--border-color) !important;
  color: var(--bg-color) !important;
}

.page-item.active .page-link {
  background-color: var(--text-color) !important;
  border-color: var(--border-color) !important;
  color: var(--bg-color) !important;
}

.page-item.disabled .page-link {
  background-color: var(--bg-color) !important;
  border-color: var(--border-color) !important;
  color: var(--text-muted) !important;
  opacity: 0.65;
}

/* Card dark theme support */
.card {
  background-color: var(--bg-color) !important;
  border-color: var(--border-color) !important;
  color: var(--text-color) !important;
}


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

.card-subtitle {
  color: var(--text-color) !important;
  margin-top: 5px !important;
}

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

/* Pseudo-element for the left gradient  */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 15vw;
  /* Adjust the width of the gradient */
  background: linear-gradient(to right, var(--text-color-light), transparent);
  pointer-events: none;
  /* Allow clicks to pass through */
  z-index: 999;
  /* Position above other elements */
}

/* Pseudo-element for the right gradient */
body::after {
  content: "";
  position: fixed;
  top: 0;
  right: 0;
  width: 15vw;
  /* Adjust the width of the gradient */
  background: linear-gradient(to left, var(--text-color-light), transparent);
  pointer-events: none;
  /* Allow clicks to pass through */
  z-index: 999;
  /* Position above other elements */
}

/* a {
  color: #444444;
  text-decoration: none;
}

a:hover {
  color: #717ff5;
  text-decoration: none;
} */

/* Removed redundant h1–h6 font-family since body already defines it */

/*--------------------------------------------------------------
# Main
--------------------------------------------------------------*/
#main {
  margin-top: 60px; /* Match header height exactly */
  transition: all 0.3s ease-in-out;
  margin-left: 0; /* Default with sidebar hidden */
}

#main.active {
  margin-left: 310px; /* With sidebar visible, push content */
}

/* Container styles */
.container {
  width: 100%;
  padding-right: var(--bs-gutter-x, 0.75rem);
  padding-left: var(--bs-gutter-x, 0.75rem);
  margin-right: auto;
  margin-left: auto;
  max-width: 1320px; /* Bootstrap 5 max container width */
  position: relative;
  top: 30px;
}

@media (max-width: 1399px) {
  .container {
    max-width: 1140px;
  }
}

@media (max-width: 1199px) {
  .container {
    max-width: 960px;
  }
}

@media (max-width: 991px) {
  .container {
    max-width: 720px;
  }
}

@media (max-width: 767px) {
  .container {
    max-width: 540px;
  }
}

@media (max-width: 575px) {
  .container {
    max-width: 100%;
  }
}

/*--------------------------------------------------------------
# Page Title
--------------------------------------------------------------*/
.pagetitle {
  margin-bottom: 10px;
  width: 100%;       /* Ensure full width */
  max-width: 1140px; /* Match main-container max-width */
  margin: 0 auto;    /* Center like main-container */
  padding: 0 15px;   /* Match main-container padding */
  display: flex;     /* Make it a flex container */
  flex-direction: column; /* Stack items vertically */
  align-items: flex-start; /* Align items to the start */
  
}

.pagetitle h1 {
  font-size: 24px;
  margin-bottom: 0;
  font-weight: 600;
  color: var(--text-color);
  width: 100%;      /* Ensure full width */
}

/* Add a wrapper for breadcrumbs to ensure they're properly styled */
.pagetitle nav {
  width: 100%;     /* Full width for breadcrumb navigation */
}

/*--------------------------------------------------------------
# Back to top button
--------------------------------------------------------------*/
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: 15px;
  z-index: 99999;
  background: var(--bg-color);
  width: 40px;
  height: 40px;
  border-radius: 4px;
  transition: transform 0.2s ease-in;
}

.back-to-top i {
  font-size: 24px;
  color: var(--text-color);
  line-height: 0;
}


.back-to-top.active {
  visibility: visible;
  opacity: 1;
}

/*--------------------------------------------------------------
# Override some default Bootstrap stylings
--------------------------------------------------------------*/
table .dropdown-menu {
  z-index: 1060 !important;
}

/* Dropdown menus */
.dropdown-menu {
  border-radius: 4px;
  /* padding: 10px 0; */
  animation-name: dropdown-animate;
  animation-duration: 0.2s;
  animation-fill-mode: both;
  border: 1px solid var(--border-color);
  z-index: 1050;
}

.dropdown-header {
  font-weight: 600;
}

.red {
  color: red;
}

.dropdown-menu .table-responsive .table a {
  text-decoration: none;
}

.dropdown-menu .dropdown-header,
.dropdown-menu .dropdown-footer {
  text-align: center;
  font-size: 15px;
  padding: 10px 25px;
}

.dropdown-menu .dropdown-footer a {
  color: #444444;
  text-decoration: underline;
}

.dropdown-menu .dropdown-footer a:hover {
  text-decoration: none;
}

.dropdown-menu .dropdown-divider {
  border-color: var(--border-color);
  margin: 0;
}

.dropdown-menu .dropdown-item {
  font-size: 14px;
  padding: 10px 15px;
  transition: transform 0.2s ease-in;
  text-decoration: none !important;
}

.dropdown-menu .dropdown-item i {
  margin-right: 10px;
  font-size: 18px;
  line-height: 0;
}

.dropdown-menu .dropdown-item:hover {
  background-color: var(--text-color);
  color: var(--bg-color);
}

@media (min-width: 768px) {
  .dropdown-menu-arrow::before {
    content: "";
    width: 13px;
    height: 13px;
    background: var(--bg-color);
    position: absolute;
    top: -7px;
    right: 20px;
    transform: rotate(45deg);
    border-top: 1px solid var(--text-color);
    border-left: 1px solid var(--text-color);
  }
}


@keyframes dropdown-animate {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.dropdown {
  position: relative;
  background-color: var(--bg-color);
  border-color: var(--border-color);
  color: var(--text-color);
}

.card-header,
.card-footer {
  border-color: var(--border-color);
  background-color: var(--bg-color);
  color: var(--text-color);
  padding: 15px;
}

.card-title {
  padding: 20px 0 15px 0;
  font-weight: 500;
  color: var(--text-color);
  font-family: "Open Sans", sans-serif;
}

.card-title span {
  color: var(--text-color);
  font-weight: 400;
}

.card-body {
  padding: 0 20px 20px 20px;
}

.card-img-overlay {
  background-color: var(--bg-color);
}

/* Alerts */
.alert-heading {
  font-weight: 500;
  font-family: "Open Sans", sans-serif;
  font-size: 20px;
}

/* Close Button */
.btn-close {
  background-size: 25%;
}

.btn-close:focus {
  outline: 0;
  box-shadow: none;
}

/* Update main content area for responsive sidebar */
@media screen and (max-width: 1200px) {
  #main {
    margin-left: 0;
  }

  #main.active {
    margin-left: 280px;
  }
}

@media screen and (max-width: 992px) {
  #main.active {
    margin-left: 250px;
  }
}

@media screen and (max-width: 768px) {
  #main {
    margin-top: 50px; /* Match the reduced header height on mobile */
  }
  
  #main.active {
    margin-left: 0;
  }
  
  .main-container {
    padding: 10px;
  }
}

@media screen and (max-width: 576px) {
  #main.active {
    margin-left: 0;
  }

  /* Add overlay when sidebar is active on mobile */
  body.sidebar-active::before {
    content: '';
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 997; /* Below sidebar (998) but above other content */
  }
}

.main-container {
  border-radius: 10px;
  margin: 0 auto;
  padding: 0 15px;
  width: 100%;
  max-width: 1140px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  grid-area: auto;
  gap: 10px;
}

@media screen and (max-width: 768px) {
  .main-container {
    max-width: 100%;
    padding: 10px;
  }
}

@media screen and (max-width: 576px) {
  .main-container {
    max-width: 100%;
    padding: 0 8px;
  }
}


/* Ensure table headers do not wrap and maintain visibility */
.table-responsive th {
  white-space: nowrap;
}

/* Handle long email addresses or names by truncating with ellipsis */
.table td {
  overflow: visible;
  text-overflow: clip;
}

/* Tooltip for truncated text */
.table td[data-bs-toggle="tooltip"] {
  cursor: pointer;
}

@media screen and (max-width: 768px) {
  .btn-outline-secondary {
    font-size: 11px;
    padding: 0.375rem 0.75rem;
  }
}

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

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

[data-theme="dark"] .placeholder {
  color: rgba(255, 255, 255, 0.5) !important;
}

/* Hide default checkbox */
input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #007bff;
  border-radius: 4px;
  cursor: pointer;
  position: relative;
}

/* Add a custom checkmark when checked */
input[type="checkbox"]:checked::before {
  content: "✔";
  font-size: 14px;
  color: white;
  text-align: center;
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: #007bff;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 4px;
}

input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 2px solid var(--border-color);
  cursor: pointer;
  position: relative;
}

input[type="checkbox"]:checked::before {
  font-size: 14px;
  color: var(--text-color);
  text-align: center;
  position: absolute;
  background-color: var(--bg-color);
  display: flex;
  justify-content: center;
  align-items: center;
}

.dark-theme .btn-close {
  background-color: #333;
  color: #fff;
}

.dark-theme .alert {
  background-color: #444;
  color: #fff;
}

.dark-theme .alert-danger {
  background-color: #a00;
  color: #fff;
}

.dark-theme .modal-content {
  background-color: #222;
  color: #fff;
}

.dark-theme .modal-header {
  background-color: #333;
  color: #fff;
}

.dark-theme .modal-footer {
  background-color: #333;
  color: #fff;
}

.text-warning {
  color: var(--text-color-light);
}

.list-group-item {
  background-color: var(--bg-color);
  color: var(--text-color);
}

@media screen and (max-width: 768px) {
  .pagetitle {
    max-width: 100%;
    padding: 0 10px;
  }
  .pagetitle h1 {
    font-size: 18px;
  }
  .pagetitle nav {
    font-size: 12px;
  }
}

@media screen and (max-width: 576px) {
  .pagetitle {
    max-width: 100%;
    padding: 0 8px;
  }
  .pagetitle h1 {
    font-size: 14px;
  }
  .pagetitle nav {
    font-size: 10px;
  }
}

.email-text {
  font-size: 14px;
  color: var(--text-color);
}

/* Offcanvas title dark theme support */
.offcanvas-title {
  color: var(--text-color);
}

/* Offcanvas close button styling */
.offcanvas-close {
  color: var(--text-color);
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
}

/* Hide close button on larger screens */
@media (min-width: 768px) {
  .offcanvas-close {
    display: none;
  }
}

/* Always show close button on mobile/small screens */
@media (max-width: 767px) {
  .offcanvas-close {
    display: block;
  }
}

/* Dark theme close button */
[data-theme="dark"] .offcanvas-close {
  background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
}

/* Accordion chevron dark theme support */
.accordion-button::after {
  color: var(--text-color);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23333'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

[data-theme="dark"] .accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

[data-theme="dark"] .accordion-button:not(.collapsed)::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  transform: rotate(-180deg);
}

/* System theme (auto) - dark variant */
@media (prefers-color-scheme: dark) {
  [data-theme="system"] .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
  }
  
  [data-theme="system"] .accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transform: rotate(-180deg);
  }

  [data-theme="system"] .offcanvas-close {
    background: transparent url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") center/1em auto no-repeat;
  }
}

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

/* Action button icon styling */
.action-btn-icon {
  color: var(--text-color); /* Use theme text color */
  background-color: transparent; /* Ensure no background */
  border: none; /* Ensure no border */
  padding: 0; /* Remove default padding */
  cursor: pointer;
  transition: color 0.2s ease-in-out; /* Smooth transition */
}

.action-btn-icon:hover {
  color: #0d6efd; /* Use primary blue for hover in light theme */
}

/* Dark theme specific styles for action icon */
[data-theme="dark"] .action-btn-icon {
  color: var(--text-color-light); /* Lighter color for dark theme */
}

[data-theme="dark"] .action-btn-icon:hover {
  color: #ffffff; /* Bright white for hover in dark theme */
}


