/* Bootstrap 5 Custom Button Extensions */
/* Custom btn-xs equivalent for Bootstrap 5 */

.btn.btn-xs {
    padding: 0.125rem 0.25rem;
    font-size: 0.75rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

.btn.btn-icon.btn-xs {
    padding: 0.125rem;
    width: 1.5rem;
    height: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.btn-icon.btn-xs svg,
.btn.btn-icon.btn-xs i {
    width: 0.75rem;
    height: 0.75rem;
}

/* Enhanced button icon text combinations for Bootstrap 5 */
.btn-icon-text .btn-icon-prepend,
.btn-icon-text .btn-icon-append {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon-text.btn-xs .btn-icon-prepend,
.btn-icon-text.btn-xs .btn-icon-append {
    width: 0.75rem;
    height: 0.75rem;
}

/* DataTable action buttons standardization */
.datatable-actions .btn {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.datatable-actions .btn:last-child {
    margin-right: 0;
}

/* Tooltip improvements for Bootstrap 5 */
.btn[data-bs-toggle="tooltip"] {
    position: relative;
}

/* Enhanced focus states for accessibility */
.btn:focus-visible {
    outline: 2px solid var(--bs-primary);
    outline-offset: 2px;
}

/* Modal button improvements */
.modal-footer .btn {
    margin-left: 0.5rem;
}

.modal-footer .btn:first-child {
    margin-left: 0;
}

/* Responsive button adjustments */
@media (max-width: 576px) {
    .btn-xs {
        padding: 0.1875rem 0.375rem;
        font-size: 0.8125rem;
    }
    
    .datatable-actions .btn {
        margin-bottom: 0.5rem;
    }
}

/* ==========================================================================
   Bootstrap 5.1 Offcanvas component (restored — the theme's custom core build
   strips the standalone .offcanvas rules; the task drawer (x-task.task-drawer)
   depends on them). Sourced from the upstream Bootstrap 5.1.3 distribution,
   using the theme's design tokens where they exist.
   ========================================================================== */

/* Body scroll-lock while an offcanvas (or modal) is open — the theme build
   dropped the `body.modal-open` rule, so Bootstrap's ScrollBarHelper inline
   overflow:hidden was the only lock and it could stick without a visible
   overlay to dismiss. Restoring the class-based lock keeps the two in sync. */
body.modal-open {
  overflow: hidden;
}

.offcanvas {
  position: fixed;
  bottom: 0;
  z-index: var(--offcanvas-zindex, 1045);
  display: flex;
  flex-direction: column;
  max-width: 100%;
  visibility: hidden;
  background-color: #fff;
  background-clip: padding-box;
  outline: 0;
  transition: transform 0.3s ease-in-out;
}

@media (prefers-reduced-motion: reduce) {
  .offcanvas {
    transition: none;
  }
}

.offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
}

.offcanvas-header .btn-close {
  padding: 0.5rem 0.5rem;
  margin-top: -0.5rem;
  margin-right: -0.5rem;
  margin-bottom: -0.5rem;
}

.offcanvas-title {
  margin-bottom: 0;
  line-height: 1.5;
}

.offcanvas-body {
  flex-grow: 1;
  padding: 1rem 1rem;
  overflow-y: auto;
}

.offcanvas-start {
  top: 0;
  left: 0;
  width: 400px;
  border-right: 1px solid rgba(0, 0, 0, 0.2);
  transform: translateX(-100%);
}

.offcanvas-end {
  top: 0;
  right: 0;
  width: 400px;
  border-left: 1px solid rgba(0, 0, 0, 0.2);
  transform: translateX(100%);
}

.offcanvas-top {
  top: 0;
  right: 0;
  left: 0;
  height: 30vh;
  max-height: 100%;
  border-bottom: 1px solid rgba(0, 0, 0, 0.2);
  transform: translateY(-100%);
}

.offcanvas-bottom {
  right: 0;
  left: 0;
  height: 30vh;
  max-height: 100%;
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  transform: translateY(100%);
}

.offcanvas.show {
  transform: none;
}

.offcanvas-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1040;
  width: 100vw;
  height: 100vh;
  background-color: #232323;
}

.offcanvas-backdrop.fade {
  opacity: 0;
}

.offcanvas-backdrop.show {
  opacity: 0.5;
}

/* Task drawer variant — a bit wider than the 400px default so the detail
   fragment's form/timeline rows have room. */
[data-task-drawer].offcanvas-end {
  width: 480px;
}

@media (max-width: 575.98px) {
  .offcanvas-start,
  .offcanvas-end {
    width: 100%;
  }
}