#layout-navbar {
  padding: 1rem 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,.05),0 4px 12px rgba(0,0,0,.04);
  background: linear-gradient(to bottom,#fff,#fafbfc);
  border-bottom: 1px solid rgba(0,0,0,.08);
  backdrop-filter: blur(20px);
  position: relative;
}

#layout-navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right,transparent,rgba(102,126,234,.2),transparent);
}

.navbar-nav-right {
  min-width: 0;
  flex: 1 1 auto;
  gap: 1rem;
  align-items: center;
}

.user-info-wrapper {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 100%;
  margin-right: .5rem;
}

.user-info-container {
  min-width: 0;
  flex-wrap: nowrap;
  gap: .75rem;
  align-items: center;
}

.user-info-desktop,.user-info-tablet {
  gap: .75rem;
  min-width: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.user-info-tablet {
  gap: .5rem;
}

.user-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: .125rem;
  padding: 0;
}

.user-name-text {
  font-size: .9375rem;
  line-height: 1.4;
  color: #384551;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  font-weight: 600;
  letter-spacing: -.01em;
}

.user-role-text {
  font-size: .8125rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  color: #6c757d;
  font-weight: 500;
}

.user-info-tablet .user-details {
  max-width: 220px;
}

.user-info-tablet .user-name-text {
  font-size: .875rem;
  max-width: 220px;
}

.mobile-user-info {
  gap: .5rem;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  margin-left: .5rem;
  padding: 0;
  background: transparent;
  border: none;
}

.mobile-user-content {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

.mobile-user-name-wrapper {
  min-width: 0;
  overflow: hidden;
}

.mobile-user-name {
  font-size: .8125rem;
  font-weight: 600;
  color: #384551;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  margin: 0;
  letter-spacing: -.01em;
}

.navbar-actions {
  gap: .25rem;
  flex-shrink: 0;
}

.navbar-actions::before {
  content: '';
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom,transparent,rgba(0,0,0,.1),transparent);
  margin-right: .5rem;
}

.navbar-action-item {
  margin: 0;
}

.navbar-action-link {
  padding: .625rem;
  border-radius: .5rem;
  transition: all .25s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  position: relative;
  color: #495057;
}

.navbar-action-link:hover {
  background-color: rgba(102,126,234,.08);
  color: #667eea;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102,126,234,.15);
}

.navbar-action-link:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(102,126,234,.1);
}

.navbar-action-link:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
  background-color: rgba(102,126,234,.1);
}

.navbar-action-link i {
  position: relative;
  z-index: 1;
  transition: transform .25s;
}

.navbar-action-link:hover i {
  transform: scale(1.1);
}

.notification-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.notification-badge {
  font-size: .625rem;
  font-weight: 700;
  padding: .125rem .375rem;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 6px rgba(220,53,69,.4);
}

.user-avatar-link {
  padding: .25rem;
  transition: all .3s;
  border-radius: .5rem;
}

.user-avatar-link:hover {
  transform: translateY(-2px);
  background-color: rgba(102,126,234,.08);
}

.user-avatar-navbar .avatar {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,.95);
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: all .3s;
}

.user-avatar-link:hover .avatar {
  box-shadow: 0 4px 12px rgba(102,126,234,.25);
  border-color: rgba(102,126,234,.3);
  transform: scale(1.05);
}

.user-dropdown-menu {
  min-width: 280px;
  padding: 0;
  border: none;
  box-shadow: 0 4px 20px rgba(0,0,0,.15);
  border-radius: .5rem;
  margin-top: .5rem;
  overflow: hidden;
}

.user-dropdown-header {
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: #fff;
  margin: 0;
  padding: 0;
}

.user-dropdown-header .d-flex {
  background: transparent;
}

.user-dropdown-avatar-wrapper {
  position: relative;
  flex-shrink: 0;
}

.user-dropdown-avatar {
  width: 56px;
  height: 56px;
  border: 3px solid rgba(255,255,255,.3);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}

.avatar-status-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #28a745;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,.2);
}

.user-dropdown-info {
  min-width: 0;
}

.user-dropdown-name {
  font-size: 1rem;
  color: #fff;
  margin-bottom: .25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0,0,0,.1);
}

.user-dropdown-role {
  font-size: .8125rem;
  color: rgba(255,255,255,.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown-menu .dropdown-divider {
  margin: 0;
  border-color: rgba(0,0,0,.08);
}

.user-dropdown-session {
  background-color: #f8f9fa;
  margin: 0;
  padding: 0;
}

.user-dropdown-session .px-3 {
  background-color: transparent;
}

.session-icon-dropdown {
  font-size: 1.125rem;
  flex-shrink: 0;
}

.session-badge-dropdown {
  font-family: 'Courier New','Consolas',monospace;
  font-weight: 600;
  font-size: .875rem;
  padding: .4375rem .75rem;
  letter-spacing: .5px;
  border-radius: .375rem;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

.session-badge-dropdown.bg-success {
  background-color: #28a745!important;
  color: #fff;
}

.session-badge-dropdown.bg-warning {
  background-color: #ffc107!important;
  color: #000;
}

.session-badge-dropdown.bg-danger {
  background-color: #dc3545!important;
  color: #fff;
}

.user-dropdown-item {
  padding: .625rem 1rem;
  display: flex;
  align-items: center;
  transition: all .2s;
  color: #384551;
  text-decoration: none;
  border: none;
  background: none;
  width: 100%;
  cursor: pointer;
}

.user-dropdown-item:hover {
  background-color: #f8f9fa;
  color: #0d6efd;
  padding-left: 1.25rem;
}

.user-dropdown-item i {
  font-size: 1.125rem;
  width: 20px;
  text-align: center;
}

.user-dropdown-item span {
  flex: 1;
}

.user-dropdown-logout {
  color: #dc3545!important;
  border-top: 1px solid rgba(0,0,0,.08);
  margin-top: .25rem;
}

.user-dropdown-logout:hover {
  background-color: #fff5f5!important;
  color: #c82333!important;
}

.user-dropdown-logout i {
  color: #dc3545;
}

.user-dropdown-logout:hover i {
  color: #c82333;
}

.layout-menu-toggle {
  margin-right: .75rem!important;
  flex-shrink: 0!important;
  z-index: 1000!important;
  display: flex!important;
  align-items: center!important;
}

.layout-menu-toggle.d-xl-none {
  display: flex!important;
}

.mobile-menu-toggle-btn {
  padding: .625rem!important;
  border-radius: .5rem!important;
  transition: all .25s!important;
  display: flex!important;
  align-items: center!important;
  justify-content: center!important;
  min-width: 44px!important;
  height: 44px!important;
  background-color: transparent!important;
  border: none!important;
  cursor: pointer!important;
  text-decoration: none!important;
  position: relative;
}

.mobile-menu-toggle-btn:hover {
  background-color: rgba(102,126,234,.08)!important;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102,126,234,.15);
}

.mobile-menu-toggle-btn:active {
  background-color: rgba(102,126,234,.12)!important;
  transform: translateY(0);
}

.mobile-menu-toggle-btn:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.mobile-menu-toggle-btn i {
  font-size: 1.5rem!important;
  color: #495057!important;
  display: block!important;
  position: relative;
  z-index: 1;
  transition: transform .25s;
}

.mobile-menu-toggle-btn:hover i {
  color: #667eea!important;
  transform: scale(1.1);
}

@media (min-width: 1200px) {
  .user-name-text,.user-role-text {
    max-width: 250px;
  }
}

@media (max-width: 1199.98px) and (min-width: 992px) {
  .user-name-text {
    max-width: 200px;
    font-size: .875rem;
  }
  .user-role-text {
    max-width: 200px;
    font-size: .75rem;
  }
}

@media (max-width: 991.98px) and (min-width: 768px) {
  #layout-navbar {
    padding: .625rem .875rem;
  }
  .user-info-container {
    gap: .5rem;
  }
  .user-info-tablet .user-name-text {
    max-width: 140px;
    font-size: .8125rem;
  }
  .navbar-actions {
    gap: .125rem;
  }
  .navbar-action-link {
    min-width: 38px;
    height: 38px;
    padding: .4375rem;
  }
}

@media (max-width: 767.98px) {
  .user-info-wrapper {
    margin-right: .25rem;
  }
  .navbar-actions::before {
    display: none;
  }
  #layout-navbar {
    padding: .5rem .75rem;
  }
  .user-info-container {
    gap: .375rem;
  }
  .mobile-user-info {
    gap: .375rem;
  }
  .mobile-user-name {
    font-size: .75rem;
    max-width: 120px;
  }
  .navbar-action-link {
    min-width: 36px;
    height: 36px;
    padding: .375rem;
  }
  .notification-badge {
    font-size: .5625rem;
    min-width: 16px;
    height: 16px;
    padding: .0625rem .3125rem;
  }
}

@media (max-width: 575.98px) {
  #layout-navbar {
    padding: .5rem .625rem;
  }
  .navbar-nav-right {
    gap: .25rem;
  }
  .user-info-container {
    gap: .375rem;
    flex: 1 1 auto;
    min-width: 0;
  }
  .mobile-user-info {
    gap: .25rem;
    flex: 1 1 auto;
    min-width: 0;
    max-width: calc(100vw - 160px);
    margin-left: .25rem;
  }
  .mobile-user-content {
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
  }
  .mobile-user-name {
    font-size: .75rem;
    max-width: 100%;
  }
  .navbar-actions {
    gap: .125rem;
    flex-shrink: 0;
  }
  .navbar-action-link {
    min-width: 32px;
    height: 32px;
    padding: .3125rem;
  }
  .navbar-action-link i {
    font-size: 1.125rem;
  }
  .notification-badge {
    font-size: .5rem;
    min-width: 14px;
    height: 14px;
    padding: .0625rem .25rem;
    border-width: 1.5px;
  }
  .user-avatar-navbar .avatar {
    width: 30px;
    height: 30px;
  }
  .user-dropdown-menu {
    min-width: calc(100vw - 2rem);
    max-width: 320px;
    margin-top: .375rem;
  }
  .user-dropdown-avatar {
    width: 48px;
    height: 48px;
  }
  .user-dropdown-name {
    font-size: .9375rem;
  }
  .user-dropdown-role {
    font-size: .75rem;
  }
  .layout-menu-toggle {
    margin-right: .5rem!important;
  }
  .mobile-menu-toggle-btn {
    min-width: 40px!important;
    height: 40px!important;
    padding: .5rem!important;
  }
  .mobile-menu-toggle-btn i {
    font-size: 1.375rem!important;
  }
}
