/**
 * Top header bar — Adobe XD: one white floating bar, search left, actions right.
 */

:root {
  --co-topbar-padding-x: 30px;
  --co-topbar-outer-height: 80px;
  --co-topbar-bg: #f4f7fb;
  --co-topbar-surface: #ffffff;
  --co-topbar-border: #e8ecf1;
  --co-topbar-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  --co-topbar-icon: #374151;
  --co-layout-gutter: 30px;
}

.co-layout .co-main {
  background: var(--co-topbar-bg);
}

/* Outer strip — grey bg + 30px side padding */
.co-layout .co-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: var(--co-topbar-outer-height);
  height: auto;
  padding: 16px var(--co-topbar-padding-x) !important;
  background: var(--co-topbar-bg) !important;
  border-bottom: none;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
  box-sizing: border-box;
}

/* Single white card (XD) */
.co-layout .co-topbar__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  min-width: 0;
  height: 56px;
  padding: 0 20px 0 22px;
  background: var(--co-topbar-surface);
  border: 1px solid var(--co-topbar-border);
  border-radius: 12px;
  box-shadow: var(--co-topbar-shadow);
  box-sizing: border-box;
}

/* Search — borderless inside the bar */
.co-layout .co-topbar__search {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 520px;
  height: auto;
  padding: 0;
  margin: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  position: relative;
}

.co-layout .co-topbar__search:focus-within {
  border: none !important;
  box-shadow: none !important;
}

.co-layout .co-topbar__search-icon {
  color: #9ca3af;
  flex-shrink: 0;
}

.co-layout .co-topbar__search-input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9375rem;
  color: #6b7280;
  width: 100%;
  min-width: 0;
  padding: 0;
}

.co-layout .co-topbar__search-input::placeholder {
  color: #9ca3af;
}

/* Actions — inline on the right, no second card */
.co-layout .co-topbar__actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 24px;
}

.co-layout .co-topbar__toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.co-layout .co-topbar__icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--co-topbar-icon);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.co-layout .co-topbar__icon-btn:hover {
  background: #f3f4f6;
  color: #111827;
  text-decoration: none;
}

.co-layout .co-topbar__bell-menu {
  position: relative;
}

.co-layout .co-topbar__bell {
  position: relative;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--co-topbar-icon);
}

.co-layout .co-topbar__bell:hover {
  background: #f3f4f6;
  color: #111827;
}

.co-layout .co-topbar__badge--dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 9px;
  height: 9px;
  min-width: 0;
  padding: 0;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
  font-size: 0;
  line-height: 0;
  overflow: hidden;
  text-indent: -9999px;
}

.co-layout .co-topbar__user-menu {
  position: relative;
  margin-left: 2px;
}

.co-layout .co-topbar__avatar-wrap {
  position: relative;
  display: inline-flex;
}

.co-layout .co-topbar__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--primaryColor, #1a75e6);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 0;
  box-shadow: none;
  transition: box-shadow 0.15s ease;
}

.co-layout .co-topbar__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.co-layout .co-topbar__avatar:hover {
  box-shadow: 0 0 0 3px rgba(26, 117, 230, 0.15);
}

.co-layout .co-topbar__avatar-status {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #fff;
  pointer-events: none;
}

.co-layout .co-topbar__hamburger {
  display: none;
  flex-shrink: 0;
  color: var(--co-topbar-icon);
}

/* Hide "mark all as read" if cached Opigno markup is still served */
.co-layout .co-bell-notifications .all-read {
  display: none !important;
}

/* Kill legacy style.css split search / toolbar chrome */
.co-layout .co-topbar .co-topbar__search,
.co-layout .co-topbar .co-topbar__search:focus-within,
.co-layout .co-topbar .co-topbar__toolbar {
  background-image: none !important;
  background-position: initial !important;
  border-right: none !important;
}

@media (max-width: 768px) {
  :root {
    --co-topbar-padding-x: 16px;
  }

  .co-layout .co-topbar {
    padding-top: 12px !important;
    padding-bottom: 12px !important;
  }

  .co-layout .co-topbar__hamburger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--co-topbar-border);
    border-radius: 12px;
    background: var(--co-topbar-surface);
    box-shadow: var(--co-topbar-shadow);
  }

  .co-layout .co-topbar__bar {
    height: 48px;
    padding: 0 12px;
  }

  .co-layout .co-topbar__search {
    max-width: none;
  }

  .co-layout .co-topbar__actions {
    margin-left: 12px;
  }

}
