
/* Phase26 final UI fixes */
.app-header,
.bnc-smart-header,
.bnc-smart-header .main-header-container,
.bnc-smart-header .bnc-header-shell {
  overflow: visible !important;
}

body[data-bnc-theme] .app-header {
  overflow: visible !important;
}

.bnc-smart-header {
  position: sticky;
  top: 0;
  z-index: 2200 !important;
  isolation: isolate;
}

.bnc-smart-header .dropdown-menu,
.bnc-smart-header .main-header-dropdown,
.bnc-smart-header .header-profile-dropdown {
  z-index: 2215 !important;
  margin-top: .55rem !important;
  border-radius: 18px !important;
  overflow: hidden;
}

.main-content,
.app-content,
.custom-card,
.card,
.main-sidebar,
.app-sidebar {
  z-index: auto;
}

@media (min-width: 1200px) {
  .bnc-header-shell {
    direction: rtl;
    justify-content: space-between;
    align-items: center;
    gap: .9rem;
  }
  .bnc-header-main {
    order: 1;
    flex: 0 1 21rem;
    min-width: 0;
    gap: .55rem;
  }
  .bnc-header-mid {
    order: 2;
    flex: 1 1 38rem;
    min-width: 0;
    justify-content: flex-start;
    padding-inline: .35rem 1rem;
  }
  .bnc-header-end {
    order: 3;
    flex: 0 0 auto;
    justify-content: flex-end;
    gap: .55rem;
  }
  .bnc-header-search {
    width: min(100%, 38rem);
    margin: 0;
  }
  .bnc-header-copy {
    max-width: 12rem;
  }
  .bnc-header-page-title {
    font-size: .96rem;
  }
  .bnc-header-page-subtitle {
    display: none;
  }
  .bnc-header-brand .header-logo img {
    max-height: 1.75rem;
  }
}

@media (max-width: 1199.98px) {
  .bnc-header-main {
    flex: 1 1 auto;
  }
  .bnc-header-end {
    margin-inline-start: auto;
  }
}

.app-sidebar .category-name {
  color: var(--bnc-text-soft, #64748b) !important;
  opacity: 1 !important;
  font-weight: 800;
}

.app-sidebar .main-menu > .slide > .side-menu__item,
.app-sidebar .slide-menu .side-menu__item {
  color: var(--bnc-text-strong, #1e293b) !important;
  opacity: 1 !important;
  border-radius: 14px;
}

.app-sidebar .main-menu > .slide > .side-menu__item .side-menu__icon,
.app-sidebar .main-menu > .slide > .side-menu__item .side-menu__label,
.app-sidebar .main-menu > .slide > .side-menu__item .side-menu__angle,
.app-sidebar .slide-menu .side-menu__item .side-menu__label,
.app-sidebar .slide-menu .side-menu__item .side-menu__angle,
.app-sidebar .slide-menu .side-menu__item .side-menu__icon {
  color: inherit !important;
  opacity: 1 !important;
}

.app-sidebar .main-menu > .slide > .side-menu__item:hover,
.app-sidebar .main-menu > .slide > .side-menu__item.active,
.app-sidebar .slide-menu .side-menu__item:hover,
.app-sidebar .slide-menu .side-menu__item.active {
  background: color-mix(in srgb, var(--bnc-accent, #3b82f6) 10%, transparent) !important;
  color: var(--bnc-primary-strong, #1d4ed8) !important;
}

html[data-theme-mode="dark"] .app-sidebar,
html[data-theme-mode="dark"] .main-sidebar {
  background: rgba(2, 6, 23, .92) !important;
}

html[data-theme-mode="dark"] .app-sidebar .category-name {
  color: rgba(148, 163, 184, .95) !important;
}

html[data-theme-mode="dark"] .app-sidebar .main-menu > .slide > .side-menu__item,
html[data-theme-mode="dark"] .app-sidebar .slide-menu .side-menu__item {
  color: rgba(226, 232, 240, .9) !important;
}

html[data-theme-mode="dark"] .app-sidebar .main-menu > .slide > .side-menu__item:hover,
html[data-theme-mode="dark"] .app-sidebar .main-menu > .slide > .side-menu__item.active,
html[data-theme-mode="dark"] .app-sidebar .slide-menu .side-menu__item:hover,
html[data-theme-mode="dark"] .app-sidebar .slide-menu .side-menu__item.active {
  background: rgba(var(--bnc-primary-rgb), .16) !important;
  color: #ffffff !important;
}

body[data-bnc-theme] select,
body[data-bnc-theme] .form-select,
body[data-bnc-theme] select.form-control,
body[data-bnc-theme] .dataTables_wrapper select {
  min-height: 46px;
  border-radius: 14px !important;
  padding-inline: .95rem 2.8rem !important;
  border: 1px solid rgba(var(--bnc-primary-rgb), .16) !important;
  background-color: rgba(255,255,255,.96) !important;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(var(--bnc-primary-rgb), .92) 50%),
    linear-gradient(135deg, rgba(var(--bnc-primary-rgb), .92) 50%, transparent 50%) !important;
  background-position:
    calc(1rem) calc(50% - 2px),
    calc(.66rem) calc(50% - 2px) !important;
  background-size: .55rem .55rem, .55rem .55rem !important;
  background-repeat: no-repeat !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .05) !important;
  color: var(--bnc-text-strong, #0f172a) !important;
  appearance: none;
  -webkit-appearance: none;
}

html[data-theme-mode="dark"] body[data-bnc-theme] select,
html[data-theme-mode="dark"] body[data-bnc-theme] .form-select,
html[data-theme-mode="dark"] body[data-bnc-theme] select.form-control,
html[data-theme-mode="dark"] body[data-bnc-theme] .dataTables_wrapper select {
  background-color: rgba(15,23,42,.88) !important;
  color: #e2e8f0 !important;
  border-color: rgba(148,163,184,.2) !important;
  box-shadow: 0 14px 30px rgba(2, 6, 23, .28) !important;
}

.table-responsive,
.bnc-scroll-x,
.bnc-auto-table-scroll,
[data-bnc-scroll="x"] {
  position: relative;
  overflow: auto hidden !important;
  max-width: 100%;
  padding-bottom: .35rem;
  scrollbar-width: auto;
  scrollbar-color: color-mix(in srgb, var(--bnc-accent, #3b82f6) 70%, #5b6b88) rgba(226,232,240,.95);
}

.table-responsive::-webkit-scrollbar,
.bnc-scroll-x::-webkit-scrollbar,
.bnc-auto-table-scroll::-webkit-scrollbar,
[data-bnc-scroll="x"]::-webkit-scrollbar {
  height: 14px;
}

.table-responsive::-webkit-scrollbar-track,
.bnc-scroll-x::-webkit-scrollbar-track,
.bnc-auto-table-scroll::-webkit-scrollbar-track,
[data-bnc-scroll="x"]::-webkit-scrollbar-track {
  background: rgba(226,232,240,.92);
  border-radius: 999px;
}

.table-responsive::-webkit-scrollbar-thumb,
.bnc-scroll-x::-webkit-scrollbar-thumb,
.bnc-auto-table-scroll::-webkit-scrollbar-thumb,
[data-bnc-scroll="x"]::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, color-mix(in srgb, var(--bnc-accent, #3b82f6) 75%, #4f46e5), color-mix(in srgb, var(--bnc-accent-alt, #8b5cf6) 65%, var(--bnc-accent, #3b82f6)));
  border-radius: 999px;
  border: 3px solid rgba(226,232,240,.92);
}

html[data-theme-mode="dark"] .table-responsive::-webkit-scrollbar-track,
html[data-theme-mode="dark"] .bnc-scroll-x::-webkit-scrollbar-track,
html[data-theme-mode="dark"] .bnc-auto-table-scroll::-webkit-scrollbar-track,
html[data-theme-mode="dark"] [data-bnc-scroll="x"]::-webkit-scrollbar-track {
  background: rgba(30,41,59,.96);
}

html[data-theme-mode="dark"] .table-responsive::-webkit-scrollbar-thumb,
html[data-theme-mode="dark"] .bnc-scroll-x::-webkit-scrollbar-thumb,
html[data-theme-mode="dark"] .bnc-auto-table-scroll::-webkit-scrollbar-thumb,
html[data-theme-mode="dark"] [data-bnc-scroll="x"]::-webkit-scrollbar-thumb {
  border-color: rgba(30,41,59,.96);
}

.bnc-auto-table-scroll > table,
.table-responsive > table,
.bnc-scroll-x > table,
[data-bnc-scroll="x"] > table {
  min-width: max-content;
}

.bnc-form-progress {
  top: 4.9rem;
  padding: .45rem .6rem;
  gap: .45rem;
  border-radius: 16px;
}

.bnc-form-progress-item {
  min-width: 138px;
  padding: .42rem .6rem;
  border-radius: 14px;
}

.bnc-form-progress-index,
.bnc-form-step-badge {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  font-size: .72rem;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--bnc-accent, #3b82f6) 18%, transparent);
}

.bnc-form-progress-copy strong {
  font-size: .78rem;
}

.bnc-form-progress-copy small {
  display: none;
}

.bnc-sticky-submit-bar {
  padding: .55rem .7rem;
  border-radius: 14px;
}

@media (max-width: 991.98px) {
  .bnc-form-progress {
    top: 4.45rem;
  }
  .bnc-form-progress-item {
    min-width: 120px;
  }
}

/* Phase27 header + sidebar alignment refinements */
@media (min-width: 1200px) {
  .bnc-header-shell {
    direction: ltr;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
  }
  .bnc-header-main,
  .bnc-header-mid,
  .bnc-header-end {
    direction: rtl;
    min-width: 0;
  }
  .bnc-header-main {
    order: 3;
    flex: 0 1 18.5rem;
    justify-content: flex-start;
    gap: .5rem;
  }
  .bnc-header-mid {
    order: 2;
    flex: 1 1 auto;
    justify-content: center;
    padding-inline: .5rem;
  }
  .bnc-header-end {
    order: 1;
    flex: 0 0 auto;
    justify-content: flex-start;
    gap: .5rem;
    margin-inline: 0;
  }
  .bnc-header-search {
    width: min(100%, 40rem);
    margin-inline: auto;
  }
  .bnc-header-copy {
    max-width: 13rem;
  }
}

.bnc-smart-header .main-header-container .header-link.bnc-header-icon-btn,
.bnc-smart-header .main-header-container .sidemenu-toggle.header-link.bnc-header-icon-btn {
  padding: 0 !important;
  height: auto !important;
  min-height: 2.55rem;
  inline-size: 2.55rem;
  border-inline-start: 0 !important;
  flex: 0 0 auto;
}

.bnc-smart-header .main-header-container .sidemenu-toggle.header-link.bnc-header-icon-btn {
  margin: 0;
  align-self: center;
}

.bnc-header-brand {
  flex: 0 0 auto;
}

.bnc-header-theme-trigger,
.bnc-header-profile-trigger,
.bnc-smart-header .bnc-header-end .bnc-header-icon-btn {
  position: relative;
  z-index: 3;
}

.app-sidebar {
  padding-inline: .55rem !important;
}

.app-sidebar .main-sidebar-header {
  padding: .8rem .55rem .55rem !important;
}

.app-sidebar .main-sidebar {
  padding-inline: .1rem !important;
}

.app-sidebar .main-menu {
  padding-inline: 0 !important;
  margin-inline: 0 !important;
}

.app-sidebar .main-menu > .slide,
.app-sidebar .slide-menu > .slide {
  margin-block: .14rem;
}

.app-sidebar .main-menu > .slide > .side-menu__item,
.app-sidebar .slide-menu .side-menu__item {
  padding: .68rem .78rem !important;
  gap: .58rem;
}

.app-sidebar .main-menu > .slide > .side-menu__item .side-menu__icon,
.app-sidebar .slide-menu .side-menu__item .side-menu__icon {
  margin-inline: 0 !important;
}

html[data-theme-mode="dark"] .app-sidebar {
  box-shadow: inset 0 0 0 1px rgba(148,163,184,.08);
}

@media (max-width: 1199.98px) {
  .bnc-header-main {
    flex: 1 1 auto;
  }
  .bnc-header-end {
    margin-inline-start: auto;
  }
}
