/*
* style.css
* File include item demo only specific css only
******************************************************************************/

.menu .app-brand {
  margin-top: 12px;
  margin-bottom: 10px;
}

/* ! For .layout-navbar-fixed added fix padding top tpo .layout-page */
/* Detached navbar */
.layout-navbar-fixed .layout-wrapper:not(.layout-horizontal):not(.layout-without-menu) .layout-page {
  padding-top: 76px !important;
}

/* Default navbar */
.layout-navbar-fixed .layout-wrapper:not(.layout-without-menu) .layout-page {
  padding-top: 64px !important;
}

/* Navbar page z-index issue solution */
.content-wrapper .navbar {
  z-index: auto;
}

.new_formBtn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: fixed;
  bottom: 50px;
  right: 50px;
  z-index: 1000;
  box-shadow: 0 24px 48px 0 #b59c66a6;
  border: none;
  cursor: pointer;
  animation: bounce 1s infinite;
}

@media (max-width: 700px) {
  .new_formBtn {
    bottom: 16px;
    right: 16px;
  }
}

@keyframes bounce {
  0%,
  100% {
    animation-timing-function: cubic-bezier(.8, 0, 1, 1);
    transform: translateY(-25%);
  }

  50% {
    animation-timing-function: cubic-bezier(0, 0, .2, 1);
    transform: none;
  }
}

/* How to button - positioned at left, no animation */
.howto_btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: fixed;
  bottom: 50px;
  left: 280px; /* Positioned after sidebar */
  z-index: 1000;
  box-shadow: 0 24px 48px 0 rgba(67, 89, 113, 0.3);
  border: none;
  cursor: pointer;
  /* No animation - removed the bounce */
}

@media (max-width: 1200px) {
  .howto_btn {
    left: 50px;
  }
}

@media (max-width: 700px) {
  .howto_btn {
    bottom: 16px;
    left: 16px;
  }
}

/* Ensure Select2 dropdowns render above Bootstrap modals */
.modal .select2-container {
  z-index: 2050 !important; /* higher than .modal (1055) and backdrop (1050) */
}

/* Popper warning fix: use offset modifier (data-bs-offset), not CSS margins */
.popper-safe-dropdown[data-bs-popper] {
  margin: 0 !important;
}

/* Ensure the manual transaction modal content is scrollable */
#manualTransactionModal .modal-dialog {
  max-height: 90vh !important;
  margin: 1rem auto;
}
#manualTransactionModal .modal-content {
  max-height: 100% !important;
  height: 100% !important;
  display: flex;
  flex-direction: column;
}
#manualTransactionModal .modal-body {
  overflow-y: auto !important;
  max-height: calc(90vh - 140px) !important; /* approx header+footer */
}

/* Loading shimmer effect for statistics cards */
.stats-card-loading {
  position: relative;
  pointer-events: none;
}

.stats-card-loading::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  border-radius: 0.375rem;
  z-index: 10;
}

.stats-loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  display: none;
}

.stats-card-loading .stats-loading-spinner {
  display: block;
}

.spinner-border-sm {
  width: 1.5rem;
  height: 1.5rem;
  border-width: 0.2em;
}

/* Shimmer animation alternative */
@keyframes shimmer {
  0% {
    background-position: -468px 0;
  }
  100% {
    background-position: 468px 0;
  }
}

.stats-shimmer {
  animation: shimmer 1.5s infinite;
  background: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
  background-size: 800px 100px;
}

.stats-value-placeholder {
  height: 2.5rem;
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
}

.stats-text-placeholder {
  height: 1rem;
  border-radius: 0.25rem;
  width: 60%;
}

/* Global navbar search */
.cc-global-search {
  position: relative;
  width: min(720px, 56vw);
}

.cc-global-search .form-control {
  min-width: 320px;
}

.cc-global-search-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: min(760px, 88vw);
  max-height: 28rem;
  overflow-y: auto;
  z-index: 1080;
  border: 1px solid #e5e7eb;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.15);
}

.cc-global-search-results {
  padding: 0.5rem;
}

.cc-global-search-group + .cc-global-search-group {
  border-top: 1px solid #eef2f7;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
}

.cc-global-search-group-label {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6b7280;
  padding: 0.25rem 0.5rem;
}

.cc-global-search-item {
  display: block;
  text-decoration: none;
  border-radius: 0.5rem;
  padding: 0.45rem 0.6rem;
  color: inherit;
}

.cc-global-search-item:hover,
.cc-global-search-item.is-active {
  background-color: #f3f6fb;
}

.cc-global-search-item-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.cc-global-search-item-subtitle {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  color: #6b7280;
  margin-top: 0.12rem;
}

.cc-global-search-item-type {
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: #eef2f7;
  color: #374151;
  border-radius: 999px;
  padding: 0.1rem 0.38rem;
}

.cc-global-search-empty {
  padding: 0.85rem 0.75rem;
  color: #6b7280;
  font-size: 0.82rem;
}

@media (max-width: 991.98px) {
  .cc-global-search {
    width: min(480px, 76vw);
  }

  .cc-global-search .form-control {
    min-width: 220px;
  }

  .cc-global-search-dropdown {
    width: min(560px, 90vw);
  }
}

@media (max-width: 767.98px) {
  .cc-global-search {
    width: min(220px, 46vw);
  }

  .cc-global-search .form-control {
    min-width: 120px;
    font-size: 0.82rem;
  }

  .cc-global-search .bx-search {
    font-size: 1rem !important;
  }

  .cc-global-search-dropdown {
    width: min(92vw, 520px);
    left: -10px;
  }
}

@media (max-width: 420px) {
  .cc-global-search {
    width: min(170px, 42vw);
  }

  .cc-global-search .form-control {
    min-width: 92px;
    padding-left: 0.35rem;
    padding-right: 0.25rem;
  }
}

/* Global dark mode */
html.dark-style {
  color-scheme: dark;
  --bs-body-color: #d1d5db;
  --bs-body-color-rgb: 209, 213, 219;
  --bs-body-bg: #0f172a;
  --bs-body-bg-rgb: 15, 23, 42;
}

html.dark-style body {
  background-color: #0f172a;
  color: #d1d5db;
}

html.dark-style h1,
html.dark-style h2,
html.dark-style h3,
html.dark-style h4,
html.dark-style h5,
html.dark-style h6,
html.dark-style .h1,
html.dark-style .h2,
html.dark-style .h3,
html.dark-style .h4,
html.dark-style .h5,
html.dark-style .h6 {
  color: #f3f4f6;
}

html.dark-style .text-muted {
  color: #9ca3af !important;
}

html.dark-style .layout-page,
html.dark-style .content-wrapper {
  background-color: #0f172a;
}

html.dark-style .card,
html.dark-style .accordion-item,
html.dark-style .modal-content,
html.dark-style .dropdown-menu,
html.dark-style .list-group-item,
html.dark-style .toast,
html.dark-style .offcanvas {
  background-color: #1f2937;
  color: #e5e7eb;
  border-color: #374151;
}

html.dark-style .bg-navbar-theme {
  background-color: #1f2937 !important;
  border: 1px solid #374151;
}

html.dark-style .bg-menu-theme {
  background-color: #111827 !important;
  border-right: 1px solid #374151;
}

html.dark-style .bg-footer-theme {
  background-color: #1f2937 !important;
  border-top: 1px solid #374151;
}

html.dark-style .bg-navbar-theme .navbar-nav > .nav-link,
html.dark-style .bg-navbar-theme .navbar-nav > .nav-item > .nav-link {
  color: #d1d5db !important;
}

html.dark-style .menu-vertical .menu-item .menu-link,
html.dark-style .menu-vertical .menu-item .menu-link .menu-icon,
html.dark-style .menu-vertical .menu-header,
html.dark-style .menu-vertical .menu-sub .menu-link {
  color: #cbd5e1 !important;
}

html.dark-style .bg-menu-theme .menu-link:hover,
html.dark-style .bg-menu-theme .menu-link:focus {
  background-color: rgba(255, 255, 255, 0.05) !important;
  color: #ffffff !important;
}

html.dark-style .bg-menu-theme .menu-item.active > .menu-link,
html.dark-style .bg-menu-theme .menu-item.open > .menu-link {
  background-color: rgba(255, 145, 0, 0.2) !important;
  color: #ffbe73 !important;
}

html.dark-style .menu-inner-shadow {
  background: linear-gradient(#111827 41%, rgba(17, 24, 39, 0.11) 95%, rgba(17, 24, 39, 0));
}

html.dark-style .footer-link,
html.dark-style a,
html.dark-style .text-primary {
  color: #ffbe73 !important;
}

html.dark-style a:hover,
html.dark-style a:focus {
  color: #ffd4a1 !important;
}

html.dark-style .table {
  color: #e5e7eb;
  --bs-table-bg: transparent;
  --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
  --bs-table-hover-bg: rgba(255, 255, 255, 0.05);
  --bs-table-border-color: #374151;
}

html.dark-style .table > :not(caption) > * > * {
  border-bottom-color: #374151;
}

html.dark-style .table thead.table-secondary,
html.dark-style .table thead.table-light,
html.dark-style .table .table-secondary,
html.dark-style .table .table-light {
  --bs-table-bg: #1f2937;
  --bs-table-color: #f3f4f6;
  color: #f3f4f6;
}

html.dark-style .table thead.table-secondary th,
html.dark-style .table thead.table-light th {
  background-color: #1f2937 !important;
  color: #f3f4f6 !important;
  border-bottom-color: #374151 !important;
}

html.dark-style .table .badge.bg-label-secondary {
  background-color: rgba(148, 163, 184, 0.25) !important;
  color: #e5e7eb !important;
}

html.dark-style .table .badge.bg-label-primary {
  background-color: rgba(59, 130, 246, 0.25) !important;
  color: #bfdbfe !important;
}

html.dark-style .table .badge.bg-label-success {
  background-color: rgba(16, 185, 129, 0.25) !important;
  color: #a7f3d0 !important;
}

html.dark-style .table .badge.bg-label-info {
  background-color: rgba(6, 182, 212, 0.25) !important;
  color: #a5f3fc !important;
}

html.dark-style .table .badge.bg-label-warning {
  background-color: rgba(245, 158, 11, 0.25) !important;
  color: #fde68a !important;
}

html.dark-style .table .badge.bg-label-danger {
  background-color: rgba(239, 68, 68, 0.25) !important;
  color: #fecaca !important;
}

html.dark-style .dataTables_wrapper .page-item .page-link,
html.dark-style .pagination .page-item .page-link {
  background-color: #111827;
  color: #d1d5db;
  border-color: #374151;
}

html.dark-style .dataTables_wrapper .page-item.active .page-link,
html.dark-style .pagination .page-item.active .page-link {
  background-color: #ff9100;
  border-color: #ff9100;
  color: #111827;
}

html.dark-style .dataTables_wrapper .page-item.disabled .page-link,
html.dark-style .pagination .page-item.disabled .page-link {
  background-color: #0f172a;
  color: #6b7280;
  border-color: #1f2937;
}

html.dark-style .dataTables_wrapper .page-item:not(.active):not(.disabled) .page-link:hover,
html.dark-style .pagination .page-item:not(.active):not(.disabled) .page-link:hover {
  background-color: #1f2937;
  color: #f3f4f6;
}

html.dark-style .form-control,
html.dark-style .form-select,
html.dark-style .input-group-text {
  background-color: #111827;
  border-color: #374151;
  color: #e5e7eb;
}

html.dark-style .form-control:focus,
html.dark-style .form-select:focus {
  border-color: #ff9100;
  box-shadow: 0 0 0 0.2rem rgba(255, 145, 0, 0.2);
}

html.dark-style .form-control::placeholder {
  color: #9ca3af;
}

html.dark-style .form-select {
  color: #e5e7eb !important;
  -webkit-text-fill-color: #e5e7eb;
}

html.dark-style .form-select option {
  color: #e5e7eb;
  background-color: #111827;
}

html.dark-style .form-select:disabled,
html.dark-style .form-control:disabled,
html.dark-style .form-select[readonly],
html.dark-style .form-control[readonly] {
  color: #cbd5e1 !important;
  -webkit-text-fill-color: #cbd5e1;
  opacity: 1;
}

html.dark-style .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered,
html.dark-style .select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
  color: #e5e7eb !important;
}

html.dark-style .select2-container--bootstrap-5 .select2-selection--single .select2-selection__placeholder,
html.dark-style .select2-container--bootstrap-5 .select2-selection--multiple .select2-search__field::placeholder {
  color: #9ca3af !important;
}

html.dark-style .btn-outline-secondary {
  color: #d1d5db;
  border-color: #4b5563;
}

html.dark-style .btn-outline-secondary:hover {
  background-color: #374151;
  border-color: #4b5563;
  color: #ffffff;
}

html.dark-style .dropdown-divider,
html.dark-style hr {
  border-color: #374151;
  background-color: #374151;
}

html.dark-style .select2-container--bootstrap-5 .select2-selection {
  background-color: #111827 !important;
  border-color: #374151 !important;
  color: #e5e7eb !important;
}

html.dark-style .select2-container--bootstrap-5 .select2-dropdown {
  background-color: #1f2937 !important;
  border-color: #374151 !important;
}

html.dark-style .select2-container--bootstrap-5 .select2-results__option {
  color: #e5e7eb !important;
}

html.dark-style .select2-container--bootstrap-5 .select2-results__option--highlighted {
  background-color: rgba(255, 145, 0, 0.2) !important;
  color: #ffbe73 !important;
}

html.dark-style .cc-global-search-dropdown {
  background-color: #111827;
  border-color: #374151;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45);
}

html.dark-style .cc-global-search-group + .cc-global-search-group {
  border-top-color: #374151;
}

html.dark-style .cc-global-search-group-label,
html.dark-style .cc-global-search-item-subtitle,
html.dark-style .cc-global-search-empty {
  color: #9ca3af;
}

html.dark-style .cc-global-search-item:hover,
html.dark-style .cc-global-search-item.is-active {
  background-color: rgba(255, 255, 255, 0.06);
}

html.dark-style .cc-global-search-item-type {
  background-color: rgba(255, 255, 255, 0.08);
  color: #d1d5db;
}
