/* ====== Main Content ====== */
#main-content {
  margin-left: 250px;
  /* Match sidebar width */
  min-height: calc(100vh - 60px);
  /* Full height minus header */
  transition: margin-left 0.3s ease;
  /* Match sidebar animation */
  position: relative;
}

/* Adjust when sidebar is collapsed */
#sidebar.collapsed~#main-content {
  margin-left: 80px;
  /* Match collapsed sidebar width */
}

.ontopConatiner2 {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;

}

.ontoplabel2 {

  width: 50%;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;
}

.ontoplabel2 span h3 {
  font-family: 'IBM Plex Sans Thai', sans-serif;
  font-weight: 800;
  font-size: 1.3em;
  white-space: nowrap;
  margin: 0;
  line-height: 1.5em;
  display: block;
  color: #333;
}

.ontoplabel2 span h4 {
  font-family: 'IBM Plex Sans Thai', sans-serif;
  font-weight: 600;
  font-size: 1.1em;
  white-space: nowrap;
  line-height: 0;
  margin: 0;
  line-height: 1em;
  display: block;
  color: #333;
}

[data-bs-theme="dark"] .ontoplabel2 span h3, .ontoplabel2 span h4 {
  color: #fff;
}

.noWarp{
  white-space: nowrap !important;
}
@media (max-width: 767px) {
  .ontoplabel2{
    width: auto;
  }
  .ontoplabel2 span h3,
  .ontoplabel2 span h4 {
    display: none;

  }
}

/* Responsive adjustments */
@media (max-width: 991.98px) {
  #main-content {
    margin-left: 0;
    padding: 15px 10px;
  }

  #sidebar.collapsed~#main-content {
    margin-left: 0;
  }

  #sidebar:not(.collapsed)~#main-content {
    margin-left: 0;
    position: relative;
    z-index: 1;
  }
}

/* Ensure content is properly spaced */
.main-container {
  padding: 15px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  min-height: calc(100vh - 100px);
  /* Adjusted to account for reduced margins */
}

/* Page title styling */
.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0;
}

/* Top Header Styles */
.top-header {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  position: fixed;
  top: 0;
  right: 0;
  left: 250px;
  /* Align with sidebar width */
  z-index: 1000;
  padding: 0.5rem 1.5rem;
  border-bottom: 1px solid #e9ecef;
  height: auto;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.top-header .dropdown-toggle::after {
  display: none;
}

.top-header .dropdown-menu {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
  border-radius: 0.5rem;
  padding: 0.5rem 0;
  margin-top: 0.5rem;
}

.top-header .dropdown-item {
  padding: 0.5rem 1.25rem;
  font-size: 0.9rem;
  color: #333;
  transition: all 0.2s;
}

.top-header .dropdown-item:hover {
  background-color: #f8f9fa;
  color: #1a9a9a;
}

.top-header .dropdown-divider {
  margin: 0.25rem 0;
}

.user-avatar {
  color: #6c757d;
}

#mobile-menu-toggle {
  padding: 0.25rem 0.5rem;
  font-size: 1.25rem;
  line-height: 1;
}

/* Card styling */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  margin-bottom: 20px;
  border-radius: 0.5rem;
  overflow: hidden;
}

.card-header {
  background-color: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 1rem 1.25rem;
}

.card {
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
  background-color: #fff;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* General Styles */
body {
  font-family: 'IBM Plex Sans Thai', sans-serif;
  background-color: #1a9a9a;
  /* Teal background color */
  background-image: url('../images/world-map-dots.png');
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  min-height: 100vh;
}

.main-container {
  padding: 2rem;
  background-color: rgba(255, 255, 255, 0.95);
  border-radius: 10px;
  margin: 1rem auto;
  max-width: 98%;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
  min-height: calc(100vh - 96px);
  height: auto;
  margin-top: 80px;
  /* Space for fixed header */
}

/* Header Styles */
.page-title {
  color: #1a9a9a;
  /* Teal color to match theme */
  font-weight: 600;
  margin: 0;
  display: flex;
  align-items: center;
}

.page-title i {
  color: #3498db;
}

/* Table Styles */
.table {
  margin-bottom: 0;
  color: #333;
}

.table th {
  font-weight: 600;
  color: #1a9a9a;
  /* Teal color for headers */
  background-color: #f0f8f8;
  /* Light teal background */
  border-bottom: 2px solid #1a9a9a;
  padding: 1rem;
}

.table td {
  padding: 1rem;
  vertical-align: middle;
  border-color: #e0f0f0;
  /* Light teal border */
  background-color: #fff;
}

.table-hover tbody tr:hover {
  background-color: rgba(52, 152, 219, 0.05);
}

/* Badge Styles */
.badge {
  font-weight: 500;
  padding: 0.4em 0.8em;
  border-radius: 4px;
}

.bg-danger {
  background-color: #e74c3c !important;
  color: #fff !important;
}

.bg-warning {
  background-color: #f39c12 !important;
  color: #fff !important;
}

.bg-success {
  background-color: #27ae60 !important;
}

/* Button Styles */
.btn {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

/* Pagination */
.pagination .page-link {
  color: #148080;
  border: 1px solid #e2e8f0;
  margin: 0 3px;
  border-radius: 6px !important;
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.pagination .page-link:hover {
  background-color: #148080;
  color: #fff;
}

.pagination .page-item.active .page-link {
  background-color: #148080;
  border-color: #148080;
  color: #fff;
}

.pagination .page-item.disabled .page-link {
  color: #6c757d;
  background-color: #fff;
  border-color: #dee2e6;
}

.header-table {
  font-size: 1.15rem;
  font-weight: 600;
  color: #1a365d;
}

/* ===== Dark Mode Styles ===== */
[data-bs-theme="dark"] {
  --bs-body-bg: #1a1a2e;
  --bs-body-color: #e6e6e6;
  --bs-border-color: #2d3748;
  --bs-light-bg: #16213e;
  --bs-card-bg: #16213e;
  --bs-table-bg: #16213e;
  --bs-table-hover-bg: #1e2a4a;
}

/* Dark mode specific styles */
[data-bs-theme="dark"] body {
  background-color: #0A0E19;
  color: var(--bs-body-color);
}

[data-bs-theme="dark"] .card,
[data-bs-theme="dark"] .modal-content,
[data-bs-theme="dark"] .dropdown-menu {
  background-color: #0C1427;
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .table {
  --bs-table-color: var(--bs-body-color);
  --bs-table-bg: var(--bs-card-bg);
  --bs-table-border-color: var(--bs-border-color);
  --bs-table-hover-bg: var(--bs-table-hover-bg);
}

[data-bs-theme="dark"] .table thead th {
  /* background-color: #1a365d; */
  background-color: #15203C;
  color: #e2e8f0;
  border-color: #2d3748;
}

[data-bs-theme="dark"] .table td,
[data-bs-theme="dark"] .table th {
  background-color: var(--bs-table-bg);
  border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .table-hover tbody tr:hover {
  --bs-table-hover-bg: rgba(26, 32, 44, 0.5);
}

[data-bs-theme="dark"] .top-header {
  background-color: #0C1427;
  border-color: #2d3748;
}

[data-bs-theme="dark"] .top-header .text-dark,
[data-bs-theme="dark"] .top-header .dropdown-toggle,
[data-bs-theme="dark"] .top-header .dropdown-item {
  color: #e2e8f0 !important;
}

[data-bs-theme="dark"] .top-header .dropdown-menu {
  background-color: #1e2a4a;
  border-color: #2d3748;
}

[data-bs-theme="dark"] .top-header .dropdown-item:hover {
  background-color: #2d3748;
  color: #fff !important;
}

[data-bs-theme="dark"] .top-header .dropdown-divider {
  border-color: #2d3748;
}

[data-bs-theme="dark"] .top-header .user-avatar {
  color: #a0aec0;
}

[data-bs-theme="dark"] .card-header {
  background-color: #1a1a2e;
  border-color: #2d3748;
}

[data-bs-theme="dark"] .main-container {
  /* background-color: rgba(12, 20, 39); */
  background-color: #0A0E19;
  /* 0C1427 */
  color: #e2e8f0;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="dark"] .page-title {
  color: #fff;
}

/* Dark mode button styles */
[data-bs-theme="dark"] .btn-outline-primary {
  color: #63b3ed;
  border-color: #63b3ed;
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
  background-color: #2b6cb0;
  border-color: #2b6cb0;
}

[data-bs-theme="dark"] .btn-primary {
  background-color: #2b6cb0;
  border-color: #2b6cb0;
}

[data-bs-theme="dark"] .btn-primary:hover {
  background-color: #2c5282;
  border-color: #2c5282;
}

[data-bs-theme="dark"] .btn-outline-secondary {
  color: #e2e8f0;
  border-color: #4a5568;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background-color: #4a5568;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
  background-color: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #2d3748;
  border-color: #63b3ed;
  color: #e2e8f0;
  box-shadow: 0 0 0 0.25rem rgba(99, 179, 237, 0.25);
}

[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select,
[data-bs-theme="dark"] .input-group-text {
  background-color: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
  background-color: #2d3748;
  color: #e2e8f0;
  border-color: #4299e1;
  box-shadow: 0 0 0 0.25rem rgba(66, 153, 225, 0.25);
}

[data-bs-theme="dark"] .btn-outline-secondary {
  color: #e2e8f0;
  border-color: #4a5568;
}

[data-bs-theme="dark"] .btn-outline-secondary:hover {
  background-color: #4a5568;
  border-color: #4a5568;
  color: #fff;
}

[data-bs-theme="dark"] .text-muted {
  color: #a0aec0 !important;
}

[data-bs-theme="dark"] .text-dark {
  color: #fff !important;
}

[data-bs-theme="dark"] .page-item.disabled .page-link {
  background-color: #2d3748;
  border-color: #4a5568;
  color: #718096;
}

[data-bs-theme="dark"] .page-link {
  background-color: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .page-link:hover {
  background-color: #4a5568;
  color: #fff;
}

[data-bs-theme="dark"] .border-bottom,
[data-bs-theme="dark"] .border-top {
  border-color: #172036 !important;
}

/* Dark mode filter styles have been moved to filter.css */

[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .bg-white {
  background-color: #0C1427 !important;
  color: #fff !important;
}

/* Dark mode filter section styles have been moved to filter.css */


[data-bs-theme="dark"] .header-table {
  color: #fff;
}


/* Responsive */
@media (max-width: 991.98px) {
  .top-header {
    left: 0;
    padding-left: 1rem;
    height: 80px;
  }

  #main-content {
    margin-left: 0;
    width: 100%;
    padding-top: 1rem;
    margin-top: 70px;
    /* Space for fixed header on mobile */
  }

  .main-container {
    margin-top: 10px;
    min-height: calc(100vh - 100px);
  }

  .header-actions {
    width: 100%;
    margin-top: 1rem;
  }

  .header-actions .btn {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  /* Filter card responsive styles have been moved to filter.css */
}

.td-left-danger {
  border-left: 8px solid #da624a !important;
}

.td-left-success {
  border-left: 8px solid #3ac47d !important;
}

.td-left-warning {
  border-left: 8px solid #eca909 !important;
}

.text-bg-main {
  background-color: #a7ececfb !important;
}

[data-bs-theme="dark"] .text-bg-main {
  color: #000;
}

.select2-container--bootstrap-5 .select2-selection {
  min-height: 38px;
  padding: 4px 8px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  padding-left: 0;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__arrow {
  height: 36px;
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  padding-top: 2px !important;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection {
  background-color: #2d3748;
  border-color: #4a5568;
  color: #e2e8f0;
}

[data-bs-theme="dark"] .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  color: #e2e8f0;
}

/* Preloader Area Style
============================================*/
#preloader {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  position: fixed;
  background-color: #fff;
  /* background-color: #0C1427;
  color: #fff; */
}

#preloader .preloader {
  transform: translate(-50%, -50%);
  position: absolute;
  left: 50%;
  top: 50%;
}

#preloader .preloader .loader {
  position: relative;
  overflow: hidden;
  display: block;
  height: 150px;
  width: 150px;
  margin-left: auto;
  margin-right: auto;
}

#preloader .preloader .loader div {
  height: 100%;
}

#preloader .preloader .loader,
#preloader .preloader .loader div {
  padding: 8px;
  border-radius: 50%;
  border: 2px solid transparent;
  animation: rotate linear 3.5s infinite;
  border-top-color: #FAA531;
  border-bottom-color: #FAA531;
}

#preloader .preloader .waviy {
  position: relative;
  text-align: center;
  -webkit-box-reflect: below -47px linear-gradient(transparent, rgba(0, 0, 0, 0.2));
  font-size: 50px;
  font-weight: 700;
}

#preloader .preloader .waviy span {
  position: relative;
  color: #000000;
  animation-delay: 0.1s;
  display: inline-block;
  animation: waviy 1s infinite;
}

#preloader .preloader .waviy span:nth-child(2) {
  animation-delay: 0.2s;
}

#preloader .preloader .waviy span:nth-child(3) {
  animation-delay: 0.3s;
}

#preloader .preloader .waviy span:nth-child(4) {
  animation-delay: 0.4s;
}

#preloader .preloader .waviy span:nth-child(5) {
  animation-delay: 0.5s;
}

[data-bs-theme="dark"] #preloader {
  color: #fff;
  background-color: #0C1427;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  50% {
    transform: rotate(180deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes waviy {

  0%,
  40%,
  100% {
    transform: translateY(0);
  }

  20% {
    transform: translateY(-20px);
  }
}

/* Max width 767px */
@media only screen and (max-width: 767px) {
  #preloader .preloader .waviy {
    font-size: 30px;
  }
}

#backtotop {
  position: fixed;
  top: 100%;
  right: 30px;
  bottom: 30px;
  margin: auto;
  width: 40px;
  height: 40px;
  border: none;
  background-color: #FAA531;
  transform: translateY(-100%);
  z-index: 2;
  transition: all ease 0.5s;
  font-size: 20px;
  border-radius: 4px;
}

#backtotop i {
  color: #fff;
}

#backtotop:hover {
  background-color: #FAA531;
}

#contentTab .nav-link {
  color: var(--bs-gray-600);
}

#contentTab .nav-link:hover {
  color: var(--bs-gray-900);
}