/* PM Tool Theme - modern light/dark, Bootstrap 5.3 compatible */
:root{
  --app-rounded: 12px;
  --app-card-shadow: 0 6px 18px rgba(0,0,0,.05);
  --app-transition: .2s ease;
}

/* Light is default via Bootstrap variables */

html[data-bs-theme='light']{
  --bs-body-bg: #f6f7fb;
  --bs-body-color: #222;
  --bs-card-bg: #fff;
  --bs-border-color: #e6e8ef;
  --bs-link-color: #0d6efd;
}

html[data-bs-theme='dark']{
  --bs-body-bg: #0f1115;
  --bs-body-color: #e7eaf0;
  --bs-card-bg: #171a21;
  --bs-border-color: #2a2f3a;
  --bs-link-color: #6ea8fe;
}

body{
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
}

.navbar{
  border-bottom: 1px solid var(--bs-border-color);
}

/* Card polish */
.card{
  border-radius: var(--app-rounded);
  border-color: var(--bs-border-color) !important;
  box-shadow: var(--app-card-shadow);
}
.card-header{
  border-bottom-color: var(--bs-border-color) !important;
}
.card-footer{
  border-top-color: var(--bs-border-color) !important;
}

/* Table polish */
.table{
  margin-bottom: 0;
}
.table>thead th{
  position: sticky;
  top: 0;
  z-index: 1;
}
.table-striped>tbody>tr:nth-of-type(odd)>*{ /* increase contrast a bit */
  background-color: color-mix(in oklab, var(--bs-card-bg), var(--bs-body-color) 3%);
}

/* Better form controls */
.form-control, .form-select, .select2-container--bootstrap-5 .select2-selection{
  border-radius: 10px;
}

/* Select2 global sizing and visibility */
.select2-container{ width: 100% !important; }
.select2-container--bootstrap-5 .select2-selection{
  background-color: var(--bs-card-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
  border: 1px solid var(--bs-border-color) !important; /* enforce visible border after init */
  box-shadow: none;
}
.select2-container--bootstrap-5 .select2-selection:focus{
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
}
/* Some themes set transparent borders on selection variants; force our border */
.select2-container--bootstrap-5 .select2-selection--single,
.select2-container--bootstrap-5 .select2-selection--multiple{
  border: 1px solid var(--bs-border-color) !important;
}
.select2-container--bootstrap-5.select2-container--focus .select2-selection{
  border-color: var(--bs-primary) !important;
}
/* Compact size to match .form-control-sm/.form-select-sm */
.form-select.form-select-sm + .select2-container .select2-selection,
.form-control.form-control-sm + .select2-container .select2-selection{
  min-height: calc(1.5em + .5rem + 2px);
  padding-top: .25rem;
  padding-bottom: .25rem;
  font-size: .875rem;
}

/* Select2 dark mode tweaks */
html[data-bs-theme='dark'] .select2-container--bootstrap-5 .select2-selection{
  background-color: var(--bs-card-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}
html[data-bs-theme='dark'] .select2-container--bootstrap-5 .select2-results__option--highlighted{
  background-color: #2a6df4;
}

/* Filter toolbar style */
.filter-toolbar .form-label{ font-weight: 600; }
.filter-toolbar .btn{ border-radius: 10px; }

/* Theme toggle button */
.btn-theme{
  display: inline-flex;
  align-items: center;
  gap: .5rem;
}

/* Summary cards grid spacing */
#summary-cards-container .card .card-body h5{ font-weight: 600; }

/* Compact pagination */
.pagination .page-link{ border-radius: 8px; }

/* Offcanvas sidebar styling */
.app-offcanvas-nav .list-group-item{
  background-color: var(--bs-card-bg);
  color: var(--bs-body-color);
  border-color: var(--bs-border-color);
}
.app-page-header .breadcrumb{
  --bs-breadcrumb-divider-color: var(--bs-border-color);
}
.app-page-header h2{
  font-weight: 700;
}
.breadcrumb .breadcrumb-item + .breadcrumb-item::before{
  color: var(--bs-border-color);
}
.app-offcanvas-nav .list-group-item.active{
  background-color: #2a6df4;
  color: #fff;
  border-color: #2a6df4;
}
.offcanvas-header, .offcanvas-footer{
  background-color: color-mix(in oklab, var(--bs-card-bg), var(--bs-body-color) 4%);
}
.offcanvas{
  --bs-offcanvas-bg: var(--bs-card-bg);
  --bs-offcanvas-color: var(--bs-body-color);
  border-right: 1px solid var(--bs-border-color);
}

/* Global loading overlay */
.app-loading-overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.25);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}
html[data-bs-theme='dark'] .app-loading-overlay{ background: rgba(0,0,0,.45); }
.app-loading-overlay.show{ display: flex; }
/* =======================================
   BOOTSTRAP TAB FUNCTIONALITY FIX
   ======================================= */

.tab-content > .tab-pane {
  display: none;
}

.tab-content > .active {
  display: block;
}

/* For the "fade" animation */
.tab-pane.fade {
  transition: opacity .15s linear;
}

.tab-pane.fade:not(.show) {
  opacity: 0;
}