/* CTR SUITE V71 — ONE SIDEBAR ACROSS ALL POS ROUTES
   Loaded from pos/includes/design_finalize.php after the shared shell.
   Navigation links, role permissions, dropdown and print behavior are unchanged.
   This file owns only the sidebar visual geometry; module-specific CSS must
   not resize the brand header or relayout the sidebar independently. */

/* Desktop: stable header height independent of role caption length. */
#sidebar .sidebar-mobile-head {
  position:relative;
  display:flex;
  align-items:center;
  flex:0 0 auto;
  width:100%;
  min-width:0;
  min-height:94px;
  padding:0 22px;
  margin:0;
  border-bottom:1px solid rgba(235,241,255,.11);
  box-sizing:border-box;
}
#sidebar .sidebar-mobile-head .sidebar-brand {
  display:flex;
  flex:1 1 auto;
  align-items:center;
  min-width:0;
  width:100%;
  gap:12px;
  padding:0;
  margin:0;
  border:0;
  box-sizing:border-box;
}
#sidebar .sidebar-mobile-head .brand-mark {
  flex:0 0 44px;
  width:44px;
  height:44px;
  border-radius:12px;
  padding:0;
  margin:0;
  overflow:hidden;
}
#sidebar .sidebar-mobile-head .brand-mark img {
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
#sidebar .sidebar-mobile-head .brand-text {
  display:flex;
  flex:1 1 auto;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:5px;
  min-width:0;
  max-width:100%;
  line-height:1.2;
}
#sidebar .sidebar-mobile-head .brand-name {
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:17px;
  font-weight:750;
  line-height:1.2;
  letter-spacing:-.02em;
}
#sidebar .sidebar-mobile-head .powered-caption {
  display:flex;
  align-items:center;
  gap:6px;
  width:100%;
  min-width:0;
  max-width:100%;
  margin:0;
  padding:0;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:8px;
  font-weight:750;
  line-height:1.3;
  letter-spacing:.025em;
}
#sidebar .sidebar-mobile-head .powered-caption .dot {
  display:block;
  flex:0 0 5px;
  width:5px;
  height:5px;
}
#sidebar .sidebar-nav {
  min-width:0;
  min-height:0;
  overscroll-behavior:contain;
}
#sidebar .sidebar-nav .nav-item {
  box-sizing:border-box;
  min-width:0;
}
#sidebar .sidebar-nav .ic-wrap { flex-shrink:0; }
#sidebar .sidebar-profile { min-width:0; }

/* Respect both ways the desktop rail can be activated. */
@media (min-width:1181px) {
  html.ctr-sidebar-precollapsed #sidebar .sidebar-mobile-head,
  #sidebar.sidebar-collapsed .sidebar-mobile-head {
    padding:0 8px;
    min-height:78px;
    justify-content:center;
  }
  html.ctr-sidebar-precollapsed #sidebar .sidebar-mobile-head .sidebar-brand,
  #sidebar.sidebar-collapsed .sidebar-mobile-head .sidebar-brand {
    justify-content:center;
    padding:0 !important;
    margin:0 !important;
  }
}
@media (min-width:993px) and (max-width:1180px) {
  #sidebar:not(.compact-expanded) .sidebar-mobile-head {
    padding:0 8px;
    min-height:78px;
    justify-content:center;
  }
  #sidebar:not(.compact-expanded) .sidebar-mobile-head .sidebar-brand {
    justify-content:center;
    padding:0 !important;
    margin:0 !important;
  }
}
@media (max-width:992px) {
  #sidebar .sidebar-mobile-head {
    min-height:70px;
    padding:0 3px;
    gap:10px;
    margin-bottom:5px;
    border-bottom:1px solid rgba(235,241,255,.11);
  }
  #sidebar .sidebar-mobile-back {
    flex:0 0 34px;
    width:34px;
    height:34px;
    min-width:34px;
    margin:0;
  }
  #sidebar .sidebar-mobile-head .sidebar-brand { gap:9px; }
  #sidebar .sidebar-mobile-head .brand-mark {
    flex-basis:36px;
    width:36px;
    height:36px;
    border-radius:10px;
  }
  #sidebar .sidebar-mobile-head .brand-name {font-size:13px;line-height:1.2}
  #sidebar .sidebar-mobile-head .powered-caption {font-size:7px;gap:4px;letter-spacing:0}
  #sidebar .sidebar-nav { padding-top:5px; }
}
@media (max-width:380px) {
  #sidebar .sidebar-mobile-head {gap:7px}
  #sidebar .sidebar-mobile-head .brand-mark {flex-basis:32px;width:32px;height:32px}
  #sidebar .sidebar-mobile-head .brand-name {font-size:12px}
  #sidebar .sidebar-mobile-head .powered-caption {font-size:6.7px}
}
