/* Adjust margin for navbar-brand */
[dir="ltr"] .navbar-brand {
  margin-left: 0;
  margin-right: 1rem;
}

/* Adjust navbar-nav alignment */
[dir="ltr"] .navbar-nav {
  padding-left: 0px;
}

/* Adjust navbar-nav alignment */
[dir="ltr"] .nav {
  padding-left: 0px;
}

/* For LTR: Keep the pagination aligned to the left edge */
[dir="ltr"] .pagination {
  padding-left: 0;
}

/* Adjust dropdown-toggle alignment */
[dir="ltr"] .dropdown-toggle::after {
   margin-left: 0.255em;
}

[dir="ltr"] .form-select {
  padding: 0.375rem 2.25rem 0.375rem 0.75rem;
  background-position: right 0.75rem center;
}


 [dir="ltr"] .form-floating > label {
 left: 0;
 }

[dir="ltr"] .form-floating > .form-select {
  padding-left: 0.75rem;
}


[dir="rtl"] input[type="number"] {
  text-align: right;
  direction: rtl;
}

[dir="ltr"] .alert-dismissible .btn-close {
  right: 0 !important;
  left: auto !important;
}

[dir="ltr"] .alert-dismissible {
  padding-right: 3rem;
  padding-left: 1rem !important;
}

[dir="ltr"] .offcanvas-header .btn-close {
  margin-right: 0 !important;
  margin-left: auto !important;
}

[dir="ltr"]  .text-md-start {
    text-align: left !important;
}

 [dir="ltr"] .text-md-end {
    text-align: right !important;
  }

ul.pagination {
  margin-bottom: 0;
  align-self: center;
}

th.sortable {
  cursor: pointer;
  user-select: none;
}

.linkable {
  cursor: pointer;
  text-decoration: none;
  color: var(--bs-link-color, #0d6efd);
  transition: color 0.2s ease;
}

a.linkable:hover {
  text-decoration: underline;
  color: var(--bs-link-hover-color, #0a58ca);
}

/* Disabled state */
a.linkable.disabled,
a.linkable[aria-disabled='true'] {
  pointer-events: none;
  color: var(--bs-secondary-color, #6c757d);
  text-decoration: none;
  cursor: default;
  opacity: 0.6;
}

table.fixed-table {
  table-layout: fixed;
  width: 100%;
}

/* Default single-line truncation */
table.fixed-table th,
table.fixed-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Utility: Remove truncation */
.no-ellipsis {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: initial !important;
}

/* Utility: Apply truncation anywhere */
.truncate {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.multiline-truncate {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
}

/* ===== Base Layout Skeleton ===== */
:root {
  --layout-header-height: 60px;
  --layout-aside-width: 240px;
}

.layout_header {
  width: 100%;
  height: var(--layout-header-height);
  background-color: #fff;
  z-index: 1030;
}

.layout_header .navbar {
    height: var(--layout-header-height);
    padding-top: 0;
    padding-bottom: 0;
    display: flex;
    align-items: center;
}

.layout_footer {
  width: 100%;
  background-color: #fff;
  z-index: 1030;
}

/* ===== Asides ===== */
.layout_aside_left,
.layout_aside_right {
  position: fixed;
  top: var(--layout-header-height);
  width: var(--layout-aside-width);
  height: calc(100dvh - var(--layout-header-height));
  overflow-y: auto;
  background-color: #fff;
  transition:
    transform 0.35s ease-in-out,
    box-shadow 0.25s ease-in-out,
    visibility 0.25s ease-in-out;
  will-change: transform, box-shadow;
}

.layout_aside_left {
  inset-inline-start: 0; /* RTL/LTR aware */
}

.layout_aside_right {
  inset-inline-end: 0; /* RTL/LTR aware */
}

/* ===== Content Base ===== */
.layout_content {
  box-sizing: border-box;
  min-height: 100dvh;
  overflow-x: hidden;
  background-color: #fff;
  margin-inline-start: 0;
  margin-inline-end: 0;
  transition: margin 0.3s ease; /* Smooth layout shift when toggling asides */
}

/* ===== Content Modifiers ===== */

/* Only left aside visible */
.layout_content--with-left {
  margin-inline-start: var(--layout-aside-width);
}

/* Only right aside visible */
.layout_content--with-right {
  margin-inline-end: var(--layout-aside-width);
}

/* Both asides visible */
.layout_content--with-asides {
  margin-inline-start: var(--layout-aside-width);
  margin-inline-end: var(--layout-aside-width);
}

/* ===== Header & Footer Modifiers ===== */
.layout_header--fixed {
  position: fixed;
  top: 0;
  left: 0;
}

.layout_header--sticky {
  position: sticky;
  top: 0;
}

.layout_content--pt-header {
  padding-top: var(--layout-header-height);
}

.layout_footer--fixed {
  position: fixed;
  bottom: 0;
  left: 0;
}

.layout_footer--sticky {
  position: sticky;
  bottom: 0;
}

/* ===== Aside Modifiers ===== */
.layout_aside_left--sticky,
.layout_aside_right--sticky {
  position: sticky;
  top: 0;
}

.layout_aside_left--fixed,
.layout_aside_right--fixed {
  position: fixed;
  top: 0;
}

.layout_aside_left--collapsed {
  transform: translateX(-100%);
  visibility: hidden;
  box-shadow: none;
}

.layout_aside_right--collapsed {
  transform: translateX(100%);
  visibility: hidden;
  box-shadow: none;
}

/* Expanded (visible) */
.layout_aside_left:not(.layout_aside_left--collapsed),
.layout_aside_right:not(.layout_aside_right--collapsed) {
  visibility: visible;
}


/* ===== Base Fixed Sections ===== */
.layout_section_top--fixed,
.layout_section_bottom--fixed {
  position: fixed;
  z-index: 1020;
  background-color: #fff;
  width: 100%;
  transition: all 0.3s ease;
}

/* Positioning */
.layout_section_top--fixed {
  top: 0;
}
.layout_section_bottom--fixed {
  bottom: 0;
}

/* ===== Modifiers ===== */

/* --- Left aside only --- */
.layout_section_top--left,
.layout_section_bottom--left {
  left: var(--layout-aside-width);
  width: calc(100% - var(--layout-aside-width));
}

/* --- Right aside only --- */
.layout_section_top--right,
.layout_section_bottom--right {
  right: var(--layout-aside-width);
  width: calc(100% - var(--layout-aside-width));
}

/* --- Both asides visible --- */
.layout_section_top--asides,
.layout_section_bottom--asides {
  left: var(--layout-aside-width);
  right: var(--layout-aside-width);
  width: calc(100% - (var(--layout-aside-width) + var(--layout-aside-width)));
}

/* ===== Responsive Breakpoints ===== */
@media (max-width: 991.98px) {
  .layout_aside_left,
  .layout_aside_right {
    position: fixed;
    width: var(--layout-aside-width);
    height: calc(100dvh - var(--layout-header-height));
    z-index: 1040;
    background-color: #fff;
    transition: transform 0.35s ease, opacity 0.3s ease, visibility 0.3s ease;
  }

  .layout_content {
    margin-inline-start: 0;
    margin-inline-end: 0;
  }

  /* LTR */
  :root:dir(ltr) .layout_aside_left {
    transform: translateX(-100%);
    left: 0;
  }

  :root:dir(ltr) .layout_aside_right {
    transform: translateX(100%);
    right: 0;
  }

  /* RTL */
  :root:dir(rtl) .layout_aside_left {
    transform: translateX(100%);
    right: 0;
  }

  :root:dir(rtl) .layout_aside_right {
    transform: translateX(-100%);
    left: 0;
  }

  /* Mobile aside top/bottom modes */
  .layout_aside_left.layout_mobile--aside-top,
  .layout_aside_right.layout_mobile--aside-top {
    position: relative !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    height: auto !important;
    z-index: auto !important;
    order: 0 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  .layout_aside_left.layout_mobile--aside-top + .layout_content,
  .layout_aside_right.layout_mobile--aside-top + .layout_content {
    margin-top: 0 !important;
  }

  .layout_aside_left.layout_mobile--aside-bottom,
  .layout_aside_right.layout_mobile--aside-bottom {
    position: relative !important;
    transform: none !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100% !important;
    height: auto !important;
    z-index: auto !important;
    order: 2 !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }
}

@media (max-width: 575.98px) {
  .layout_header {
    height: var(--layout-header-height);
  }

  .layout_aside_left,
  .layout_aside_right {
    top: var(--layout-header-height);
    height: calc(100dvh - var(--layout-header-height));
  }

  .layout_header--fixed + .layout_content {
    padding-top: var(--layout-header-height);
  }
}
