/* Sidebar pushes content when open; never overlays the page on desktop. */
#main-wrapper {
  min-height: 100vh;
}
.left-sidebar {
  position: fixed !important;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: 270px !important;
  height: 100vh;
  overflow: hidden;
  z-index: 10;
  background: #fff;
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.06);
  transform: none;
  transition: transform 0.2s ease;
}
.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}
.brand-logo {
  flex-shrink: 0;
  min-height: 78px;
  max-height: none;
  overflow: visible;
  padding: 12px 16px 10px;
}
.brand-logo .logo-img {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 54px;
  width: 100%;
}
.sidebar-brand-logo,
.brand-logo img.sidebar-brand-logo {
  max-height: 42px !important;
  max-width: 48px !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-legal-name {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.25;
  color: #1f2937;
  min-width: 0;
}
.app-header .header-product-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  pointer-events: none;
}
.app-header .header-product-banner span {
  font-weight: 700;
  font-size: 1.45rem;
  color: #12263f;
  letter-spacing: -0.02em;
  line-height: 1;
}
.app-header .header-product-banner img {
  display: block;
  width: 40px;
  height: 40px;
}
.left-sidebar .scroll-sidebar {
  flex: 1 1 auto;
  min-height: 0;
  height: auto !important;
  overflow-y: auto !important;
}
.left-sidebar .fixed-profile {
  flex-shrink: 0;
}
.sidebar-nav ul .sidebar-item > .sidebar-link.active,
.sidebar-nav ul .sidebar-item.selected > .sidebar-link,
.sidebar-nav ul .sidebar-item.selected > .sidebar-link.active,
.left-sidebar .nav-group.open > .nav-group-toggle.active {
  background-color: var(--brand-primary, #5d87ff) !important;
  color: #fff !important;
}
.sidebar-nav ul .sidebar-item .sidebar-link:hover {
  background-color: rgba(var(--brand-primary-rgb, 93, 135, 255), 0.1);
  color: var(--brand-primary, #5d87ff);
}
.invoice-number-row .form-label {
  white-space: nowrap;
  margin-bottom: 0.35rem;
}
.invoice-number-row .form-control {
  height: 40px;
}
.body-wrapper,
.app-header {
  transition: margin-left 0.2s ease, width 0.2s ease, left 0.2s ease;
}
.body-wrapper {
  margin-left: 270px !important;
  min-height: 100vh;
}
.app-header {
  width: calc(100% - 270px) !important;
  left: 270px !important;
}
#main-wrapper.mini-sidebar .left-sidebar,
#main-wrapper[data-sidebartype="mini-sidebar"] .left-sidebar {
  width: 270px !important;
}
#main-wrapper.mini-sidebar .body-wrapper,
#main-wrapper[data-sidebartype="mini-sidebar"] .body-wrapper {
  margin-left: 270px !important;
}
#main-wrapper.sidebar-closed .left-sidebar {
  transform: translateX(-110%);
}
#main-wrapper.sidebar-closed .body-wrapper,
#main-wrapper.sidebar-closed.mini-sidebar .body-wrapper,
#main-wrapper.sidebar-closed[data-sidebartype="mini-sidebar"] .body-wrapper {
  margin-left: 0 !important;
}
#main-wrapper.sidebar-closed .app-header {
  width: 100% !important;
  left: 0 !important;
}
/* Collapsible sidebar groups (People, Billing, Settings). */
.nav-group > .nav-group-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: none;
  text-align: left;
}
.nav-group > .nav-group-toggle .nav-group-caret {
  margin-left: auto;
  font-size: 14px;
  transition: transform 0.15s ease;
}
.nav-group.open > .nav-group-toggle .nav-group-caret {
  transform: rotate(180deg);
}
.nav-group > .nav-group-items {
  display: none;
  list-style: none;
  padding: 0 0 4px 0;
  margin: 0;
}
.nav-group.open > .nav-group-items {
  display: block;
}
.nav-group > .nav-group-items > li > .sidebar-link {
  padding-left: 52px;
  font-size: 0.92rem;
}
#headerCollapse {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dark-transparent.sidebartoggler {
  display: none !important;
}

@media (max-width: 991.98px) {
  .left-sidebar {
    transform: translateX(-110%);
  }
  #main-wrapper.show-sidebar .left-sidebar {
    transform: none;
    z-index: 1040;
  }
  .body-wrapper,
  #main-wrapper.mini-sidebar .body-wrapper,
  #main-wrapper[data-sidebartype="mini-sidebar"] .body-wrapper,
  #main-wrapper.sidebar-closed .body-wrapper {
    margin-left: 0 !important;
  }
  .app-header,
  #main-wrapper.sidebar-closed .app-header {
    width: 100% !important;
    left: 0 !important;
  }
  #main-wrapper.show-sidebar .dark-transparent.sidebartoggler {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(15, 23, 42, 0.35);
  }
}
