:root {
  --header-bg: rgba(3, 7, 18, 0.9);
  --header-border: rgba(255, 255, 255, 0.08);
  --header-text: #e5e7eb;
  --header-panel: rgba(2, 6, 23, 0.96);
}

body {
  padding-top: 72px;
}

header.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
}

header.top-bar.translucent {
  background: rgba(3, 7, 18, 0.8);
  border-color: rgba(255, 255, 255, 0.1);
}

header.top-bar .topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

header.top-bar nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  justify-content: center;
}

header.top-bar .brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 18px;
  color: inherit;
  text-decoration: none;
}
header.top-bar .brand img,
header.top-bar .brand .brand-logo{
  height:40px;
  width:auto;
  border-radius:12px;
}

header.top-bar .brand-badge {
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  display: grid;
  place-items: center;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.5);
  color: #fff;
  font-size: 18px;
}

header.top-bar .nav-link,
header.top-bar .nav-button {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--header-text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

header.top-bar .nav-link {
  padding: 8px 12px;
  border-color: transparent;
  background: transparent;
}

header.top-bar .nav-link .nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(96, 165, 250, 0.1);
}

header.top-bar .nav-link .nav-icon svg {
  width: 20px;
  height: 20px;
  stroke: #bae6fd;
  stroke-width: 1.6;
  fill: none;
}

header.top-bar .nav-link .nav-label {
  font-weight: 600;
  letter-spacing: 0.03em;
}

header.top-bar .nav-button {
  justify-content: space-between;
  min-width: 120px;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.02);
}

.dropdown-icon {
  width: 16px;
  height: 16px;
  stroke-width: 1.4;
  stroke: #bae6fd;
  margin-right: 8px;
}
.dropdown-panel a {
  color: #fff;
}

header.top-bar .nav-link:hover,
header.top-bar .nav-button:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.05);
}

header.top-bar .nav-button .nav-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-top: 2px solid currentColor;
  transform: rotate(45deg);
  margin-left: 6px;
  transition: transform 0.2s ease;
}

header.top-bar .nav-item.open .nav-button {
  background: rgba(96, 165, 250, 0.14);
  border-color: rgba(125, 211, 252, 0.4);
}

header.top-bar .nav-item.open .nav-button .nav-caret {
  transform: rotate(135deg);
}

header.top-bar .actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

header.top-bar .bubble-button {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(14, 165, 233, 0.08);
  color: var(--header-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

header.top-bar .bubble-button:hover {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(59, 130, 246, 0.35);
  transform: translateY(-1px);
}

header.top-bar .bell-icon {
  width: 20px;
  height: 20px;
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

header.top-bar .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

header.top-bar .avatar-button {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

header.top-bar .avatar-button:hover {
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
}

header.top-bar .avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  object-fit: cover;
  display: block;
}

header.top-bar .dropdown {
  position: relative;
}

header.top-bar .dropdown-panel.user-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  min-width: 180px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(6, 11, 26, 0.95);
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.45);
  z-index: 65;
}

header.top-bar .dropdown.user-dropdown.open .dropdown-panel {
  display: flex;
}

header.top-bar .dropdown-panel.user-dropdown-panel a {
  color: rgba(229, 231, 235, 0.92);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 600;
  transition: background 0.2s ease, border-color 0.2s ease;
}

header.top-bar .dropdown-panel.user-dropdown-panel a:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

header.top-bar .btn.ghost#logoutBtn {
  width: 120px;
  justify-content: center;
  font-size: 14px;
  letter-spacing: 0.02em;
  transition: background 0.2s ease, transform 0.2s ease;
  background: rgba(59, 130, 246, 0.18);
  border-color: rgba(59, 130, 246, 0.35);
  color: #eaf4ff;
}

header.top-bar .btn.ghost#logoutBtn:hover {
  background: rgba(59, 130, 246, 0.32);
  border-color: rgba(59, 130, 246, 0.6);
  transform: translateY(-1px);
}

header.top-bar .login-btn {
  margin-left: auto;
  min-width: 150px;
  border-radius: 999px;
  padding: 10px 20px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: linear-gradient(120deg, #14b8a6, #22d3ee);
  color: #fff;
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

header.top-bar .login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.35);
}

header.top-bar .logout-btn,
header.top-bar .btn.ghost {
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  padding: 0 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--header-text);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, border-color 0.2s ease;
}

header.top-bar .logout-btn:hover,
header.top-bar .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

header.top-bar .btn[hidden],
header.top-bar .logout-btn[hidden] {
  display: none !important;
}

header.top-bar .login-btn {
  border: none;
  border-radius: 20px;
  padding: 10px 18px;
  background: linear-gradient(120deg, #2563eb, #38bdf8);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 18px 32px rgba(37, 99, 235, 0.35);
}
header.top-bar .login-btn[hidden] {
  display: none;
}

header.top-bar .nav-item {
  position: relative;
}

header.top-bar .nav-item .dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 190px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(5, 8, 22, 0.95);
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  z-index: 90;
}

header.top-bar .nav-item .dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 14px;
  color: inherit;
  text-decoration: none;
}

header.top-bar .nav-item .dropdown a:hover {
  background: rgba(255, 255, 255, 0.05);
}

header.top-bar .greeting-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(6, 11, 26, 0.85);
  font-size: 13px;
  color: var(--header-text);
  opacity: 0;
  transform: translateX(12px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

header.top-bar .greeting-pill.visible {
  opacity: 1;
  transform: translateX(0);
}

header.top-bar .greeting-pill.hidden {
  opacity: 0;
  transform: translateX(12px);
}

header.top-bar .greeting-pill[hidden] {
  display: none !important;
}

header.top-bar .notif-panel {
  position: absolute;
  right: 50px;
  top: calc(100% + 12px);
  width: min(360px, calc(100vw - 32px));
  border-radius: 24px;
  background: var(--header-panel);
  border: 1px solid var(--header-border);
  padding: 18px;
  box-shadow: 0 32px 58px rgba(0, 0, 0, 0.55);
  display: none;
  flex-direction: column;
  gap: 12px;
  z-index: 95;
}

header.top-bar .notif-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
}

header.top-bar .notif-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.78);
}

header.top-bar .notif-item.unread {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(15, 34, 60, 0.95);
}

header.top-bar .notif-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.24);
  display: grid;
  place-items: center;
  font-size: 18px;
}

header.top-bar .notif-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: rgba(229, 231, 235, 0.85);
}

@media (max-width: 768px) {
  header.top-bar .actions {
    width: 100%;
    justify-content: flex-start;
  }
  header.top-bar nav {
    width: 100%;
  }
  header.top-bar .notif-panel {
    right: 12px;
  }
}

/* Dropdown panel styles (for injected header) */
header.top-bar .nav-item {
  position: relative;
}

header.top-bar .dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 17, 35, 0.95);
  backdrop-filter: blur(12px);
  display: none;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.45);
  z-index: 40;
}

header.top-bar .nav-item.open .dropdown-panel {
  display: flex;
}

header.top-bar .dropdown-panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  color: rgba(229, 231, 235, 0.9);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid transparent;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

header.top-bar .dropdown-panel a:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.07);
  transform: translateY(-1px);
}
