.header_top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(to bottom, var(--color-white), var(--color-bg-light));
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: var(--blur-background);
}

.is-standalone-app .user-dropdown-item--install-app {
  display: none;
}

.is-standalone-app .header-upgrade-badge {
  display: none;
}

.is-standalone-app .header_top {
  min-height: 58px;
}

.is-standalone-app .header_right {
  gap: 8px;
}

.is-standalone-app .burger-btn,
.is-standalone-app .notification-btn {
  width: 40px;
  height: 40px;
  padding: 8px;
  border-radius: 12px;
}

.is-standalone-app .notification-btn {
  box-shadow: none;
}

.is-standalone-app .user-profile {
  gap: 8px;
  padding: 4px 8px 4px 4px;
}

.is-standalone-app .header_right img {
  width: 36px;
  height: 36px;
}

.is-standalone-app .company-name {
  font-size: 14px;
}

.is-standalone-app .notification-panel {
  top: calc(100% + 10px);
  width: min(420px, calc(100vw - 20px));
  max-height: min(78vh, 620px);
}

.is-standalone-app .user-dropdown {
  top: calc(100% + 10px);
}

.header-upgrade-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(251, 191, 36, 0.4);
  position: relative;
  overflow: hidden;
  border: 2px solid transparent;
  margin-left: 16px;
}

.header-upgrade-badge::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transition: left 0.5s ease;
}

.header-upgrade-badge:hover::before { left: 100%; }

.header-upgrade-badge:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(251, 191, 36, 0.5);
  border-color: rgba(255, 255, 255, 0.3);
}

.header-upgrade-badge:active { transform: translateY(0); }

.upgrade-badge-icon {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  animation: pulseCrown 2s ease-in-out infinite;
}

.upgrade-badge-icon i {
  color: white;
  font-size: 16px;
  animation: rotateCrown 3s ease-in-out infinite;
}

.upgrade-badge-content {
  display: flex;
  flex-direction: column;
  gap: 0;
  line-height: 1.2;
}

.upgrade-badge-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.upgrade-badge-text {
  font-size: 13px;
  font-weight: 700;
  color: white;
  white-space: nowrap;
}

.upgrade-badge-arrow {
  color: white;
  font-size: 12px;
  transition: transform 0.3s ease;
  margin-left: 4px;
}

.header-upgrade-badge:hover .upgrade-badge-arrow { transform: translateX(4px); }

.burger-btn {
  background: none;
  border: none;
  color: var(--color-text-medium);
  font-size: 24px;
  cursor: pointer;
  display: none;
  padding: 8px;
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
}

.burger-btn:hover {
  background-color: var(--color-bg-hover);
  color: var(--color-primary);
}

.burger-btn:active { transform: scale(0.95); }

.header_right {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.notification-wrapper,
.user-profile-wrapper { position: relative; }

.notification-btn {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  font-size: 20px;
  color: var(--color-text-muted);
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  padding: 10px;
  border-radius: var(--border-radius);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.notification-btn:hover,
.notification-btn.active {
  background: linear-gradient(135deg, var(--color-primary), #10b981);
  color: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-green);
}

.notification-btn:hover { transform: translateY(-2px); }
.notification-btn:active { transform: translateY(0) scale(0.98); }
.notification-btn i { transition: transform 0.3s ease; }
.notification-btn:hover i,
.notification-btn.active i { transform: rotate(15deg); }

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 20px;
  height: 20px;
  background: linear-gradient(135deg, var(--color-danger-start), var(--color-danger-end));
  border-radius: 10px;
  border: 2.5px solid var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  padding: 0 5px;
  box-sizing: border-box;
  animation: headerPulse 2s ease-in-out infinite;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

.notification-badge:empty { display: none; }

.notification-panel,
.user-dropdown {
  position: absolute;
  right: 0;
  background: var(--color-white);
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-15px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.notification-panel {
  top: calc(100% + 16px);
  width: 440px;
  max-height: 650px;
}

.user-dropdown {
  top: calc(100% + 12px);
  width: 280px;
}

.notification-panel::before,
.user-dropdown::before {
  content: "";
  position: absolute;
  top: -8px;
  width: 16px;
  height: 16px;
  background: var(--color-white);
  border-left: 1px solid var(--color-border);
  border-top: 1px solid var(--color-border);
  transform: rotate(45deg);
  z-index: 1;
}

.notification-panel::before { right: 20px; }
.user-dropdown::before { right: 24px; }

.notification-panel.show,
.user-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.notification-panel-header,
.user-dropdown-header {
  padding: 20px;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, var(--color-bg-light), var(--color-white));
  position: relative;
}

.notification-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.notification-panel-header::after,
.user-dropdown-header::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 20px;
  right: 20px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), transparent);
  opacity: 0.3;
}

.notification-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.notification-panel-title i { color: var(--color-primary); font-size: 20px; }

.notification-count-badge {
  background: linear-gradient(135deg, var(--color-primary), #10b981);
  color: white;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  box-shadow: 0 2px 8px var(--color-primary-hover);
  min-width: 24px;
  text-align: center;
}

.mark-all-read {
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: var(--border-radius-sm);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mark-all-read:hover {
  background: var(--color-primary);
  color: var(--color-white);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-green);
  transform: translateY(-1px);
}

.notification-list {
  max-height: 530px;
  overflow-y: auto;
  padding: 12px;
}

.notification-item {
  padding: 14px;
  border-radius: var(--border-radius);
  margin-bottom: 10px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  display: flex;
  gap: 14px;
  align-items: center;
  position: relative;
  background: var(--color-white);
  animation: slideInNotification 0.3s ease-out backwards;
}

.notification-item:hover {
  background: var(--color-bg-light);
  border-color: var(--color-border);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.notification-item.unread {
  background: linear-gradient(135deg, var(--color-white), var(--color-bg-light));
  border-color: rgba(5, 150, 105, 0.2);
  box-shadow: 0 0 0 1px rgba(5, 150, 105, 0.1);
}

.notification-item.unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 65%;
  background: linear-gradient(180deg, var(--color-primary), #10b981);
  border-radius: 0 4px 4px 0;
  box-shadow: 2px 0 6px var(--color-primary-hover);
}

.notification-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.notification-icon.info { background: linear-gradient(135deg, #059669, #10b981); color: white; }
.notification-icon.success { background: linear-gradient(135deg, var(--color-success), #34d399); color: white; }
.notification-icon.warning { background: linear-gradient(135deg, var(--color-warning), #fbbf24); color: white; }
.notification-icon.error { background: linear-gradient(135deg, var(--color-danger-start), var(--color-danger-end)); color: white; }

.notification-main {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 0;
  margin: 0;
  border: none;
  background: transparent;
  text-align: left;
  color: inherit;
  cursor: pointer;
}

.notification-main:focus-visible,
.notification-delete:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.notification-content { flex: 1; min-width: 0; }

.notification-title {
  font-weight: 700;
  color: var(--color-text-dark);
  font-size: 15px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.4;
}

.notification-message {
  font-size: 14px;
  color: var(--color-text-medium);
  line-height: 1.6;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notification-time {
  font-size: 12px;
  color: var(--color-text-light);
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.notification-delete {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  align-self: center;
  border: 1px solid #fca5a5;
  border-radius: 12px;
  background: #fff1f2;
  color: #be123c;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 14px rgba(244, 63, 94, 0.12);
  padding: 0;
}

.notification-delete:hover {
  background: #ffe4e6;
  color: #9f1239;
  border-color: #fb7185;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.14);
}

.notification-delete i {
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
}

.notification-delete.is-loading,
.notification-delete:disabled {
  cursor: wait;
  opacity: 0.8;
  transform: none;
}

.priority-badge {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-sm);
}

.priority-badge.high { background: linear-gradient(135deg, #fee2e2, #fecaca); color: var(--color-danger-end); border: 1px solid #fca5a5; }
.priority-badge.medium { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #92400e; border: 1px solid #fcd34d; }
.priority-badge.low { background: linear-gradient(135deg, #dbeafe, #bfdbfe); color: #1e40af; border: 1px solid #93c5fd; }

.notification-empty {
  padding: 80px 20px;
  text-align: center;
}

.notification-empty-icon {
  font-size: 64px;
  color: var(--color-text-light);
  margin-bottom: 20px;
  opacity: 0.4;
  animation: headerFloat 3s ease-in-out infinite;
}

.notification-empty-text {
  color: var(--color-text-medium);
  font-size: 16px;
  font-weight: 500;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: transparent;
}

.user-profile:hover {
  background-color: var(--color-bg-light);
  border-color: var(--color-border);
}

.user-profile.active {
  background-color: var(--color-bg-light);
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-hover);
}

.avatar-wrapper { position: relative; }

.header_right img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-border);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.user-profile:hover img,
.user-profile.active img {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-hover);
  transform: scale(1.05);
}

.company-name {
  font-weight: 600;
  color: var(--color-text-dark);
  font-size: 15px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.company-name::after {
  content: "\25BE";
  font-size: 12px;
  color: var(--color-text-light);
  transition: transform 0.2s ease;
}

.user-profile.active .company-name::after { transform: rotate(180deg); }

.user-dropdown-info { display: flex; align-items: center; gap: 12px; }
.user-dropdown-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-hover);
}

.user-dropdown-details { flex: 1; min-width: 0; }
.user-dropdown-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--color-text-dark);
  margin-bottom: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-company {
  font-size: 13px;
  color: var(--color-text-medium);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-dropdown-content { padding: 12px; }
.user-dropdown-section { margin-bottom: 12px; }

.user-dropdown-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 12px;
  margin-bottom: 6px;
}

.user-dropdown-lang { padding: 8px 12px; }

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--color-text-dark);
  text-decoration: none;
  border: 1px solid transparent;
  margin-bottom: 4px;
}

.user-dropdown-item:hover {
  background: var(--color-bg-light);
  border-color: var(--color-border);
  transform: translateX(4px);
}

.user-dropdown-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--color-bg-light), var(--color-white));
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.user-dropdown-item:hover .user-dropdown-item-icon {
  background: linear-gradient(135deg, var(--color-primary), #10b981);
  color: var(--color-white);
  border-color: var(--color-primary);
  transform: rotate(5deg) scale(1.05);
}

.user-dropdown-item-text { flex: 1; }
.user-dropdown-item-label { font-weight: 600; font-size: 14px; margin-bottom: 2px; }
.user-dropdown-item-desc { font-size: 12px; color: var(--color-text-light); }
.user-dropdown-divider { height: 1px; background: var(--color-border); margin: 8px 12px; }

@keyframes pulseCrown {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0); }
}

@keyframes rotateCrown {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}

@keyframes headerPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.15); }
}

@keyframes headerFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes slideInNotification {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 1024px) {
  .header-upgrade-badge { padding: 6px 12px; gap: 8px; margin-left: 12px; }
  .upgrade-badge-icon { width: 28px; height: 28px; }
}

@media (max-width: 768px) {
  .header_top { padding: 12px 16px; }
  .header-upgrade-badge { margin-left: auto; padding: 6px 10px; gap: 6px; }
  .upgrade-badge-content,
  .upgrade-badge-arrow,
  .header-logo,
  .company-name { display: none; }
  .header-upgrade-badge::after {
    content: "PRO";
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 8px;
    font-weight: 900;
    color: white;
    background: #dc2626;
    padding: 2px 4px;
    border-radius: 4px;
    letter-spacing: 0.5px;
  }
  .burger-btn { display: flex; }
  .notification-panel {
    position: fixed;
    top: 76px;
    left: 12px;
    right: 12px;
    width: calc(100vw - 24px);
    max-width: none;
    margin: 0;
  }
  .user-dropdown {
    right: -12px;
    width: calc(100vw - 24px);
    max-width: 320px;
  }
  .notification-item {
    gap: 12px;
    padding: 12px;
  }
  .notification-delete {
    width: 36px;
    height: 36px;
    border-radius: 12px;
  }
  .notification-panel::before,
  .user-dropdown::before { right: 50%; transform: translateX(50%) rotate(45deg); }

  .is-standalone-app .header_top {
    padding-bottom: 10px;
  }

  .is-standalone-app .header-logo,
  .is-standalone-app .company-name {
    display: none;
  }

  .is-standalone-app .burger-btn {
    display: flex;
  }

  .is-standalone-app .header_right {
    gap: 6px;
  }

  .is-standalone-app .user-profile {
    padding-right: 4px;
  }

  .is-standalone-app .notification-panel {
    position: fixed;
    top: calc(68px + env(safe-area-inset-top));
    left: 8px;
    right: 8px;
    width: calc(100vw - 16px);
    margin: 0;
    border-radius: 18px;
  }

  .is-standalone-app .user-dropdown {
    right: -8px;
    width: calc(100vw - 16px);
    max-width: none;
    border-radius: 18px;
  }
}

@media (max-width: 480px) {
  .header_top { padding: 10px 12px; }
  .header-upgrade-badge { padding: 5px 8px; margin-left: 8px; }
  .notification-panel { top: 72px; left: 8px; right: 8px; width: calc(100vw - 16px); margin: 0; }
  .user-dropdown { width: calc(100vw - 16px); max-width: none; }

  .is-standalone-app .header_top {
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }
}
