
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 24px;
  padding: 0 24px;
  max-width: 1400px;
  margin: 0 auto;
  overflow: visible;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: #111827;
  transition: opacity 0.2s;
  flex-shrink: 0;
}

.brand:hover {
  opacity: 0.8;
}

.brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #34d399;
  font-weight: 700;
  font-size: 16px;
  color: white;
  text-transform: lowercase;
}

.brand__text {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin-left: 32px;
}

.topnav__desktop {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  margin-left: 32px;
}

.topnav__header,
.topnav__menu,
.topnav__category,
.topnav__item,
.topnav__icon,
.topnav__text {
  display: none;
}

.topnav__link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  color: #6b7280;
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.topnav__link i {
  font-size: 14px;
  color: #9ca3af;
  transition: color 0.15s;
}

.topnav__link:hover {
  color: #111827;
  background: #f9fafb;
}

.topnav__link:hover i {
  color: #34d399;
}

.topnav__link.is-active {
  color: #34d399;
  font-weight: 600;
}

.topnav__dropdown {
  position: relative;
}

.topnav__link--dropdown {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  border: none;
  background: transparent;
  font-family: inherit;
}

.topnav__chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.topnav__dropdown:hover .topnav__chevron {
  transform: rotate(180deg);
}

.topnav__dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 320px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  max-height: 500px;
  overflow-y: auto;
}

.topnav__dropdown:hover .topnav__dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.topnav__dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.15s;
}

.topnav__dropdown-item:hover {
  background: #f9fafb;
}

.topnav__dropdown-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-radius: 10px;
  flex-shrink: 0;
}

.topnav__dropdown-icon svg {
  width: 20px;
  height: 20px;
  color: #34d399;
}

.topnav__dropdown-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.topnav__dropdown-title {
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  line-height: 1.3;
}

.topnav__dropdown-desc {
  font-size: 12px;
  color: #6b7280;
  line-height: 1.3;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  position: relative;
}

.topbar__link {
  padding: 8px 16px;
  border-radius: 6px;
  color: #6b7280;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.topbar__link:hover {
  color: #111827;
  background: #f9fafb;
}

.topbar__user-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  color: #6b7280;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.15s;
  white-space: nowrap;
}

.topbar__user-link:hover {
  color: #111827;
  background: #f9fafb;
}

.topbar__user-link svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.topbar__auth-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
  border: 1.5px solid #e5e7eb;
  color: #374151;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.topbar__auth-btn:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  border-color: #34d399;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.25);
}

.topbar__auth-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.topbar__auth-btn:hover svg {
  transform: translateX(2px);
}

.topbar__actions .btn--primary {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  background: #34d399;
  color: white;
  border: none;
  box-shadow: none;
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
}

.topbar__actions .btn--primary:hover {
  background: #10b981;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.25);
}

.topbar__actions .btn--secondary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  border: 1.5px solid #e5e7eb;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s;
  white-space: nowrap;
  text-decoration: none;
}

.topbar__actions .btn--secondary:hover {
  background: #f9fafb;
  border-color: #34d399;
  color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(251, 191, 36, 0.15);
}

.topbar__actions .btn--secondary svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mobile-menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  z-index: 1001;
}

.mobile-menu-toggle__bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #374151;
  border-radius: 2px;
  transition: all 0.3s;
  position: absolute;
  left: 9px;
}

.mobile-menu-toggle__bar:nth-child(1) {
  top: 12px;
}

.mobile-menu-toggle__bar:nth-child(2) {
  top: 19px;
}

.mobile-menu-toggle__bar:nth-child(3) {
  top: 26px;
}

.mobile-menu-toggle.is-active .mobile-menu-toggle__bar:nth-child(1) {
  transform: rotate(45deg);
  top: 19px;
}

.mobile-menu-toggle.is-active .mobile-menu-toggle__bar:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.is-active .mobile-menu-toggle__bar:nth-child(3) {
  transform: rotate(-45deg);
  top: 19px;
}

.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.mobile-overlay.is-active {
  opacity: 1;
  pointer-events: all;
}

.topbar.is-scrolled {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

@media (max-width: 1024px) {
  .topnav {
    margin-left: 20px;
    gap: 2px;
  }

  .topnav__link {
    padding: 8px 12px;
    font-size: 14px;
  }

  .topbar__actions {
    gap: 6px;
  }

  .topbar__link {
    padding: 8px 14px;
    font-size: 13px;
  }

  .topbar__actions .btn--primary {
    padding: 9px 18px;
    font-size: 13px;
  }
}

@media (max-width: 768px) {
  .topbar__inner {
    height: 60px;
    padding: 0 16px;
    gap: 12px;
  }

  .brand__mark {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 10px;
  }

  .brand__text {
    font-size: 17px;
  }

  .topnav__link {
    display: none;
  }

  .topnav__header,
  .topnav__menu,
  .topnav__category,
  .topnav__item,
  .topnav__icon,
  .topnav__text {
    display: block;
  }

  .topnav__header {
    display: flex;
  }

  .topnav__item {
    display: flex;
  }

  .topnav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 85%;
    height: 100vh;
    background: #ffffff;
    border-left: none;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    margin-left: 0;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
  }

  .topnav.is-open {
    right: 0;
    display: grid;
    align-content: start;
  }

  .topnav__header {
    display: flex;
    background: #34d399;
    padding: 24px 20px;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .topnav__profile {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
  }

  .topnav__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #ffffff;
    flex-shrink: 0;
  }

  .topnav__avatar--placeholder {
    background: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
  }

  .topnav__avatar--placeholder svg {
    width: 24px;
    height: 24px;
  }

  .topnav__user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .topnav__name {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
  }

  .topnav__role {
    font-size: 13px;
    font-weight: 500;
    color: rgba(17, 24, 39, 0.7);
    line-height: 1.2;
  }

  .topnav__signout {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    color: #111827;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
  }

  .topnav__signout:hover {
    background: rgba(0, 0, 0, 0.15);
  }

  .topnav__signout svg {
    width: 16px;
    height: 16px;
  }

  .topnav__menu {
    background: #ffffff;
    padding: 8px 0;
    flex: 1;
  }

  .topnav__category {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 12px 20px 8px;
  }

  .topnav__item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    color: #111827;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
  }

  .topnav__item:hover {
    background: #f9fafb;
  }

  .topnav__item.is-active {
    background: #fef3c7;
    border-left-color: #34d399;
  }

  .topnav__icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke: currentColor;
  }

  .topnav__text {
    flex: 1;
  }

  .topnav__item--logout {
    margin-top: 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(0,0,0,.08);
    color: #ef4444;
  }

  .topnav__item--logout:hover {
    background: #fef2f2;
    color: #dc2626;
  }

  .topnav__item--logout .topnav__icon {
    color: #ef4444;
  }

  .topnav__item--primary {
    margin-top: 12px;
    padding-top: 18px;
    border-top: 1px solid rgba(0,0,0,.08);
    background: #34d399;
    color: #ffffff;
    font-weight: 600;
  }

  .topnav__item--primary:hover {
    background: #10b981;
    color: #ffffff;
  }

  .topnav__item--primary .topnav__icon {
    color: #ffffff;
  }

  .topnav__item--secondary {
    background: #ffffff;
    color: #34d399;
    border: 2px solid #34d399;
    font-weight: 600;
  }

  .topnav__item--secondary:hover {
    background: #ecfdf5;
    color: #10b981;
    border-color: #10b981;
  }

  .topnav__item--secondary .topnav__icon {
    color: #34d399;
  }

  .topnav__item--secondary:hover .topnav__icon {
    color: #10b981;
  }

  .topbar__actions {
    gap: 8px;
  }

  .topbar__link {
    display: none;
  }

  .topbar__actions .btn--primary {
    padding: 9px 16px;
    font-size: 13px;
  }

  .mobile-menu-toggle {
    display: block;
  }

  .mobile-overlay {
    display: block;
  }

  .topnav__mobile-section {
    padding: 16px 0;
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
  }

  .topnav__mobile-section:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }

  .topnav__mobile-title {
    font-size: 11px;
    font-weight: 700;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    padding: 0 24px;
  }
}

@media (max-width: 480px) {
  .brand__text {
    display: none;
  }

  .topbar__actions .btn--primary {
    padding: 9px 14px;
    font-size: 12px;
  }

  .topnav {
    width: 260px;
  }

  .topbar__auth-btn .btn-text,
  .btn--secondary .btn-text {
    display: none;
  }

  .topbar__auth-btn {
    padding: 9px;
    min-width: 40px;
    justify-content: center;
  }

  .btn--secondary {
    display: none !important;
  }

  .topbar__actions .btn--secondary {
    display: none !important;
  }

  .topnav__desktop {
    display: none;
  }

  .user-dropdown {
    display: block;
  }

  .user-dropdown__info {
    display: none;
  }

  .user-dropdown__trigger {
    padding: 6px;
    gap: 0;
  }

  .user-dropdown__avatar {
    width: 32px;
    height: 32px;
  }

  .user-dropdown__chevron {
    display: none;
  }

  .user-dropdown__menu {
    right: 0;
    left: auto;
    min-width: 200px;
  }

  .topnav__header {
    display: flex;
  }

  .topnav__menu,
  .topnav__category,
  .topnav__item {
    display: block;
  }

  .topnav__item {
    display: flex;
  }

  .topnav__icon {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .topnav__icon svg {
    width: 20px;
    height: 20px;
    color: currentColor;
  }
}

.user-dropdown {
  position: relative;
}

.user-dropdown__trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 0;
}

.user-dropdown__trigger:hover {
  background: #f9fafb;
}

.user-dropdown__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #e5e7eb;
}

.user-dropdown__avatar--placeholder {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 600;
  text-transform: uppercase;
}

.user-dropdown__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  max-width: 150px;
}

.user-dropdown__name-text {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown__role-text {
  font-size: 11px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-dropdown__chevron {
  width: 16px;
  height: 16px;
  color: #6b7280;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.user-dropdown__trigger.is-active .user-dropdown__chevron {
  transform: rotate(180deg);
}

.user-dropdown__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  padding: 4px;
}

.user-dropdown__menu.is-active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-dropdown__item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s;
  border-radius: 6px;
}

.user-dropdown__item:hover {
  background: #f9fafb;
  color: #111827;
}

.user-dropdown__item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: #6b7280;
}

.user-dropdown__item:hover svg {
  color: #34d399;
}

.user-dropdown__item--danger {
  color: #dc2626;
}

.user-dropdown__item--danger:hover {
  background: #fef2f2;
  color: #dc2626;
}

.user-dropdown__item--danger svg {
  color: #dc2626;
}

.user-dropdown__divider {
  height: 1px;
  background: #e5e7eb;
  margin: 3px 0;
}

.notification-center {
  position: relative;
}

.notification-center__trigger {
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  position: relative;
  color: #6b7280;
}

.notification-center__trigger:hover {
  background: #f9fafb;
  color: #111827;
}

.notification-center__trigger svg {
  width: 20px;
  height: 20px;
}

.notification-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  min-width: 18px;
  height: 18px;
  background: #ef4444;
  color: white;
  font-size: 11px;
  font-weight: 700;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}
