.header {
  height: 64px;
  position: fixed;
  top: 0;
  right: 0;
  left: var(--sidebar-width);
  padding: 0 24px;
  background-color: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 999;
  transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.header.collapsed {
  left: var(--sidebar-collapsed-width);
}

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

.hamburger {
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-muted);
  width: 36px;
  height: 36px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-right: 8px;
  font-size: 18.7px;
}

.hamburger:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
}

.searchWrap {
  position: relative;
  flex: 0 1 420px;
  margin: 0 24px;
}

.searchBar {
  width: 100%;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  transition: all 0.2s ease;
}

.searchBar:focus-within {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: var(--shadow-ring);
}

.searchBar i {
  color: var(--text-light);
  font-size: 15.4px;
}

.searchBar input {
  border: none;
  background: transparent;
  width: 100%;
  outline: none;
  font-size: 14.3px;
  color: var(--text-main);
  font-weight: 500;
}

.searchClear {
  border: none;
  background: transparent;
  color: var(--text-light);
  display: inline-flex;
  align-items: center;
  padding: 2px;
  cursor: pointer;
  font-size: 12.1px;
}
.searchClear:hover {
  color: var(--text-main);
}

/* ----- Global search dropdown ----- */
.searchPanel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 1002;
  max-height: 60vh;
  overflow-y: auto;
}

.searchHint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px;
  font-size: 14.3px;
  color: var(--text-muted);
}

.searchGroup {
  padding: 4px 0;
}
.searchGroup + .searchGroup {
  border-top: 1px solid var(--border);
}

.searchGroupLabel {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  padding: 6px 10px 4px;
}

.searchItem {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  color: var(--text-main);
  transition: background 0.12s ease;
}
.searchItem:hover {
  background: var(--primary-light);
}
.searchItem > i {
  color: var(--primary);
  font-size: 17.6px;
  flex-shrink: 0;
}

.searchItemName {
  font-size: 14.3px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}

.searchItemMeta {
  font-size: 12.1px;
  color: var(--text-muted);
  text-transform: capitalize;
  flex-shrink: 0;
  max-width: 45%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


.notification {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.iconWrap {
  position: relative;
}

.iconWrap button {
  position: relative;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 10px;
  font-size: 19.8px;
  transition: all 0.2s;
}

.iconWrap button:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-light);
}

.iconWrap button[aria-expanded="true"] {
  background: var(--primary-light);
  color: var(--primary);
}

/* notification dot */
.iconWrap button[data-badge]::after {
  content: attr(data-badge);
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--error);
  color: #fff;
  font-size: 9.9px;
  font-weight: 700;
  height: 16px;
  min-width: 16px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 2px solid var(--surface);
  line-height: 1;
}



/* Dropdown & Profile */
.profile {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px;
  border-radius: 12px;
  transition: all 0.2s;
}

.profile img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  flex-shrink: 0;
}

.dropdown {
  position: relative;
}

.dropdown button {
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 15.4px;
  color: var(--text-main);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.2s;
}

.dropdown button:hover {
  background: var(--background);
}

/* Submenu / Tooltip style */
.submenu, .message {
  position: absolute;
  top: calc(100% + 16px);
  right: 0;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  list-style: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1001;
}

.submenu.active, .message.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}


.submenu li {
  margin: 2px 0;
}

.submenu li a {
  display: block;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-main);
  text-decoration: none;
  font-size: 15.4px;
  font-weight: 500;
  transition: all 0.2s;
}

.submenu li a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

/* Messages & Notifications specific */
.message {
  width: 320px;
  padding: 0;
  overflow: hidden;
}

.body {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--background);
}

.body span:first-child {
  font-weight: 700;
  font-size: 16.5px;
  color: var(--text-main);
}

.body span:last-child {
  font-size: 13.2px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
}


@media (max-width: 991px) {
  .header {
    left: 0 !important;
    padding: 0 16px;
  }
  .searchBar {
    display: none;
  }
}
