:root{
  --menu-bg:#ffffff;
  --menu-fg:#111827;
  --menu-accent:#2563eb;
  --menu-hover:#f3f4f6;
  --border:#e5e7eb;
}

.app-shell{
  display:flex;
  min-height:100vh;
  height:100vh;
  overflow:hidden;
  background:#fff;
  color:#111;
}

.app-menu{
  position:fixed;
  top:0;
  left:0;
  height:100vh;
  width:220px;
  background:var(--menu-bg);
  color:var(--menu-fg);
  transition:width .2s ease;
  z-index:1000;
  border-right:1px solid var(--border);
  display:flex;
  flex-direction:column;
  align-items:stretch;
  overflow:hidden;
}

/* Collapsed state (icons only) */
.app-menu.collapsed{
  width:55px;
}

.app-menu.collapsed .brand{
  justify-content:center;
  padding-left:0;
  padding-right:0;
}

/* In collapsed mode, keep only the burger visible to center-align the header block. */
.app-menu.collapsed .brand .org{
  display:none;
}

.app-menu .brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-bottom:none;
  position:relative; /* for banner-loader */
}

/* burger button (kept your white style) */
.app-menu .brand .burger{
  width:32px;
  height:32px;
  min-width:32px;
  min-height:32px;
  flex:0 0 32px;
  border-radius:8px;
  background:#fff;
  color:var(--menu-fg);
  display:grid;
  place-items:center;
  cursor:pointer;
  user-select:none;
  transition:background .15s ease, border-color .15s ease;
}

.app-menu .brand .burger:hover{
  background:var(--menu-hover);
}

.app-menu .brand .burger .burger-logo{
  width:25px;
  height:25px;
  object-fit:contain;
  display:block;
}

/* Org block (icon + name) */
.app-menu .brand .org{
  display:flex;
  align-items:center;
  gap:10px;
  min-width:0; /* allow title ellipsis */
  flex:1;
}

.app-menu .brand .org-icon{
  width:36px;
  height:36px;
  border-radius:10px;
  display:grid;
  place-items:center;
  font-weight:700;
  color:#111827;
  background:rgba(17,24,39,0.08);
  overflow:hidden;
  flex:0 0 36px;
  min-width:36px;
  min-height:36px;
}

/* org name */
.app-menu .brand .title{
  font-weight:600;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  opacity:.95;
  transition:opacity .15s ease, width .2s ease, margin .2s ease;
  width:auto;
}

/* Smooth collapse: hide org name */
.app-menu.collapsed #appOrgName{
  opacity:0;
  width:0;
  margin:0;
  pointer-events:none;
}

/* nav */
.app-menu nav{
  display:flex;
  flex-direction:column;
  flex:1 1 auto;
  min-height:0;
  padding:8px 6px;
  padding-bottom:18px;
  gap:4px;
  overflow-y:auto;
  overscroll-behavior:contain;
  scrollbar-gutter:stable;
}

/* Chandan - 2026-04-13: In collapsed mode, keep scroll but avoid reserving gutter/scrollbar space
   (it visually shifts centered icons to the left on narrow sidebars). */
.app-menu.collapsed nav{
  scrollbar-gutter:auto;
  scrollbar-width:none; /* Firefox */
  overflow-x:visible;
}
.app-menu.collapsed nav::-webkit-scrollbar{
  width:0;
  height:0;
}

.app-menu .menu-divider{
  height:1px;
  margin:10px 8px;
  background:var(--border);
  opacity:.9;
}

.app-menu.collapsed .menu-divider{
  margin:10px 6px;
}

.app-menu a{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 10px;
  border-radius:8px;
  color:var(--menu-fg);
  text-decoration:none;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  transition:background .15s ease;
}

.app-menu a:hover{
  background:var(--menu-hover);
}

.app-menu a.active{
  background:#96d1fb;
}

/* Font Awesome icon styling (your HTML uses <i class="fa-...">, not .icon) */
.app-menu a > i{
  width:28px;
  min-width:28px;
  display:grid;
  place-items:center;
  opacity:.9;
  font-size:16px;
  line-height:1;
  flex:0 0 28px;
}

/* Smooth text hide instead of display:none */
.app-menu .text{
  flex:1;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  transition:opacity .15s ease, width .2s ease;
}

.app-menu.collapsed .text{
  opacity:0;
  width:0;
  flex:0 0 0;
  pointer-events:none;
}

/* On collapse: center icons cleanly */
.app-menu.collapsed a{
  justify-content:center;
  padding-left:0;
  padding-right:0;
  gap:0;
}

/* content offset */
.app-content{
  margin-left:220px;
  transition:margin-left .2s ease;
  width:100%;
  min-width:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.app-content > .header,
.app-content > .page-banner,
.app-content > .page-header{
  position: sticky;
  top: 0;
  z-index: 30;
  flex: 0 0 auto;
}

.app-content > .app-content-scroll{
  flex:1 1 auto;
  min-height:0;
  overflow-x:auto;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}

.app-content .access-banner-text{
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  background: #fff7ed;
  border: 1px solid #fdba74;
  border-radius: 999px;
  padding: 6px 12px;
}

.app-content .global-trial-badge{
  position: relative;
  margin-left: 0;
  margin-right: 10px;
  display: none;
  align-items: center;
  border-radius: 999px;
  padding: 7px 11px;
  border: 1px solid #fdba74;
  background: #fff7ed;
  color: #92400e;
  box-shadow: 0 8px 18px rgba(120, 53, 15, .08);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  line-height: 1;
}

.app-content .access-banner-text:not([hidden]) + .global-trial-badge{
  margin-left: 8px;
}

.app-content .global-trial-badge.visible{
  display: inline-flex;
}

.app-content .global-trial-badge.ended{
  border-color: #fca5a5;
  background: #fef2f2;
  color: #991b1b;
}

.app-content .global-trial-badge::after{
  content: attr(data-callout);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: max-content;
  max-width: 280px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
  white-space: normal;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .25);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  z-index: 60;
}

.app-content .global-trial-badge:hover::after,
.app-content .global-trial-badge:focus::after{
  opacity: 1;
  transform: translateY(0);
}

.app-menu.collapsed ~ .app-content{
  margin-left:64px;
}

/* Optional top bar for pages that want a header */
.page-header{
  position:sticky;
  top:0;
  z-index:5;
  background:#fff;
  padding:12px 16px;
  border-bottom:1px solid #e5e7eb;
  display:flex;
  justify-content:space-between;
  align-items:center;
}

/* ==============================
   FIX: banner-loader inside menu header shouldn't change height
   ============================== */
.app-menu .brand .banner-loader{
  display:none !important;
}

.app-menu .brand .banner-loader *{
  display:block;
  margin:0 !important;
}

/* Burger tooltip (ChatGPT-like) */
.app-menu .brand .burger{
  position: relative; /* needed for tooltip */
}

/* Tooltip bubble */
.app-menu .brand .burger::after{
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: #111827;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 1200;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}

/* Small arrow */
.app-menu .brand .burger::before{
  content: "";
  position: absolute;
  left: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #111827;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 1199;
}

/* Show tooltip on hover */
.app-menu .brand .burger:hover::after,
.app-menu .brand .burger:hover::before{
  opacity: 1;
}

.app-menu .brand .burger:hover::after{
  transform: translateY(-50%) translateX(0);
}

/* Optional: on collapsed sidebar, push tooltip a bit more right */
.app-menu.collapsed .brand .burger::after{
  left: calc(100% + 12px);
}

/* ==============================
   Collapsed sidebar link tooltips
   (data-tip on nav links)
   ============================== */
.app-menu nav a{
  position:relative;
}

/* Tooltip bubble */
.app-menu.collapsed nav a[data-tip]::after{
  content: attr(data-tip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: #111827;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 7px 9px;
  border-radius: 8px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 1200;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}

/* Small arrow */
.app-menu.collapsed nav a[data-tip]::before{
  content: "";
  position: absolute;
  left: calc(100% + 6px);
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #111827;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 1199;
}

/* Show tooltip on hover/focus */
.app-menu.collapsed nav a[data-tip]:hover::after,
.app-menu.collapsed nav a[data-tip]:hover::before,
.app-menu.collapsed nav a[data-tip]:focus-visible::after,
.app-menu.collapsed nav a[data-tip]:focus-visible::before{
  opacity: 1;
}

.app-menu.collapsed nav a[data-tip]:hover::after,
.app-menu.collapsed nav a[data-tip]:focus-visible::after{
  transform: translateY(-50%) translateX(0);
}
