
/* ============================================================
   Money Culture CRM — Global Header V2
   Isolated header-only UI layer.
   No CRM data, routing, authentication or notification logic.
   ============================================================ */

:root{
  --mc-h-green:#0F6B4F;
  --mc-h-green-dark:#0B4F3A;
  --mc-h-green-soft:#EAF7F0;
  --mc-h-border:#E1E9E5;
  --mc-h-text:#18231F;
  --mc-h-muted:#728079;
}

/* Header becomes a predictable 3-zone layout.
   This replaces the old percentage-based 20/55/25 split,
   which can squeeze the right-side profile on smaller desktops. */
.topbar{
  height:76px!important;
  min-height:76px!important;
  padding:0 28px!important;
  display:grid!important;
  grid-template-columns:minmax(175px,220px) minmax(320px,1fr) auto!important;
  align-items:center!important;
  column-gap:24px!important;
  background:rgba(255,255,255,.97)!important;
  border-bottom:1px solid var(--mc-h-border)!important;
  box-shadow:0 2px 12px rgba(7,59,44,.025)!important;
  z-index:1000!important;
}

/* Left: compact page identity */
.topbar-left{
  min-width:0!important;
  width:auto!important;
  flex:none!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  gap:1px!important;
}
.breadcrumb{
  margin:0 0 2px!important;
  font-size:10px!important;
  line-height:1.2!important;
  letter-spacing:1.05px!important;
  font-weight:800!important;
  color:var(--mc-h-green)!important;
}
.topbar-title{
  font-size:21px!important;
  line-height:1.15!important;
  padding:0 0 4px!important;
  letter-spacing:-.35px!important;
  color:var(--mc-h-text)!important;
}
.topbar-title::after{
  width:24px!important;
  height:2px!important;
  bottom:0!important;
  background:var(--mc-h-green)!important;
}

/* Center: cleaner search */
.topbar-center{
  min-width:0!important;
  width:100%!important;
  flex:none!important;
  padding:0!important;
  display:flex!important;
  justify-content:center!important;
}
.search-box{
  width:100%!important;
  max-width:560px!important;
  position:relative!important;
}
.search-box input{
  height:46px!important;
  padding:0 78px 0 46px!important;
  border:1px solid #DCE6E1!important;
  border-radius:13px!important;
  background:#F9FBFA!important;
  box-shadow:none!important;
  font-size:14px!important;
}
.search-box input:hover{
  background:#fff!important;
  border-color:#C8D8D1!important;
  box-shadow:0 3px 12px rgba(7,59,44,.05)!important;
}
.search-box input:focus{
  background:#fff!important;
  border-color:#36A875!important;
  box-shadow:0 0 0 3px rgba(54,168,117,.12)!important;
}
.search-box i{
  left:16px!important;
  width:18px!important;
  height:18px!important;
  color:#7C8C84!important;
}
.search-box:focus-within i{
  color:var(--mc-h-green)!important;
}
.mc-header-search-shortcut{
  position:absolute!important;
  right:12px!important;
  top:50%!important;
  transform:translateY(-50%)!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  height:24px!important;
  padding:0 7px!important;
  border:1px solid #DCE6E1!important;
  border-radius:7px!important;
  background:#fff!important;
  color:#8A9891!important;
  font-size:10px!important;
  font-weight:700!important;
  letter-spacing:.1px!important;
  pointer-events:none!important;
}
#searchResults{
  top:calc(100% + 8px)!important;
  border-radius:14px!important;
  box-shadow:0 18px 40px rgba(7,59,44,.14)!important;
}

/* Right: actions remain visible without overflow */
.topbar-right{
  min-width:0!important;
  width:auto!important;
  flex:none!important;
  display:flex!important;
  align-items:center!important;
  justify-content:flex-end!important;
  gap:10px!important;
}
.quick-action-btn{
  height:44px!important;
  min-width:104px!important;
  padding:0 15px!important;
  justify-content:center!important;
  gap:7px!important;
  border-radius:12px!important;
  background:var(--mc-h-green)!important;
  box-shadow:0 6px 16px rgba(15,107,79,.16)!important;
  font-size:13px!important;
  white-space:nowrap!important;
}
.quick-action-btn:hover{
  background:var(--mc-h-green-dark)!important;
  transform:translateY(-1px)!important;
  box-shadow:0 9px 20px rgba(15,107,79,.20)!important;
}
.quick-action-btn svg{
  width:16px!important;
  height:16px!important;
}
.bell-link{
  width:44px!important;
  height:44px!important;
  border-radius:12px!important;
  background:#fff!important;
  border:1px solid #DCE6E1!important;
  box-shadow:none!important;
  color:#5E7068!important;
}
.bell-link:hover{
  border-color:#A9E0C4!important;
  color:var(--mc-h-green)!important;
  background:var(--mc-h-green-soft)!important;
  transform:none!important;
}
.bell-link svg{
  width:19px!important;
  height:19px!important;
}
.bell-dot{
  top:7px!important;
  right:8px!important;
  width:8px!important;
  height:8px!important;
}
.notification-count{
  top:-6px!important;
  right:-6px!important;
  min-width:19px!important;
  height:19px!important;
  line-height:15px!important;
  font-size:9px!important;
}
.notification-menu{
  position:relative!important;
  flex:none!important;
}
.profile-menu{
  min-width:120px!important;
  max-width:170px!important;
  padding-left:12px!important;
  gap:8px!important;
  border-left:1px solid var(--mc-h-border)!important;
  overflow:hidden!important;
}
.profile-menu .avatar-sm{
  flex:none!important;
}
.profile-details{
  min-width:0!important;
  overflow:hidden!important;
}
.profile-name,
.profile-role{
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  white-space:nowrap!important;
}
.profile-name{
  font-size:12.5px!important;
}
.profile-role{
  font-size:10.5px!important;
}

/* Desktop-wide: let search use more of the available middle space */
@media (min-width:1200px){
  .topbar{
    grid-template-columns:200px minmax(400px,1fr) auto!important;
    column-gap:28px!important;
  }
  .search-box{max-width:600px!important}
}

/* Smaller desktop/tablet: preserve all controls */
@media (max-width:1100px) and (min-width:769px){
  .topbar{
    padding:0 18px!important;
    grid-template-columns:150px minmax(260px,1fr) auto!important;
    column-gap:14px!important;
  }
  .topbar-title{font-size:19px!important}
  .breadcrumb{font-size:9px!important}
  .quick-action-btn{min-width:44px!important;width:44px!important;padding:0!important}
  .quick-action-btn span{display:none!important}
  .profile-details{display:none!important}
  .profile-menu{min-width:auto!important;padding-left:8px!important}
}

/* Mobile: preserve the existing working mobile behavior */
@media (max-width:768px){
  .topbar{
    height:auto!important;
    min-height:82px!important;
    padding:12px 14px 12px 70px!important;
    display:grid!important;
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:auto auto!important;
    column-gap:10px!important;
    row-gap:10px!important;
  }
  .topbar-left{
    grid-column:1!important;
    grid-row:1!important;
  }
  .topbar-center{
    grid-column:1 / -1!important;
    grid-row:2!important;
  }
  .topbar-right{
    grid-column:2!important;
    grid-row:1!important;
  }
  .topbar-title{font-size:19px!important}
  .breadcrumb{font-size:9px!important}
  .search-box{
    max-width:none!important;
    width:100%!important;
  }
  .search-box input{
    height:44px!important;
  }
  .quick-action-btn{
    min-width:44px!important;
    width:44px!important;
    height:44px!important;
    padding:0!important;
  }
  .quick-action-btn span{display:none!important}
  .profile-details{display:none!important}
  .profile-menu{
    min-width:auto!important;
    max-width:none!important;
    padding-left:7px!important;
    gap:6px!important;
  }
  .profile-menu > svg{display:none!important}
}

/* Very narrow phones */
@media (max-width:400px){
  .topbar{
    padding-left:64px!important;
    padding-right:10px!important;
  }
  .mc-header-search-shortcut{display:none!important}
  .search-box input{padding-right:14px!important}
}
