/* Live topbar styles migrated from inline styles in main/_live_topbar.html */

/* Global webkit topbar must sit above fixed legacy sidebar (z-index 1030). */
#live-topbar-root.zel-topbar {
  z-index: 1040;
}
.topbar-notif-wrap { position: relative; }
.topbar-notif-wrap .notification-item {
  cursor: pointer;
}
.topbar-notif-wrap .notification-item:hover {
  background: var(--bg-hover, rgba(255, 255, 255, 0.06));
}
.topbar-notif-wrap .notification-item.unread:hover {
  background: rgba(59, 130, 246, 0.14);
}
.topbar-notif-wrap .notification-title,
.topbar-notif-wrap .notification-item-message,
.topbar-notif-wrap .notification-ticket {
  text-decoration: none;
  cursor: pointer !important;
}
.topbar-notif-wrap .notification-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
  min-width: 1.75rem;
}
.topbar-notif-wrap .notification-dismiss {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  width: 1.1rem;
  height: 1.1rem;
  line-height: 1;
  font-size: 0.7rem;
  color: var(--text-tertiary, #9ca3af);
  cursor: pointer;
  border-radius: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0.75;
  transition: color 0.12s ease, opacity 0.12s ease;
}
.topbar-notif-wrap .notification-dismiss:hover {
  color: var(--color-danger, #ef4444);
  opacity: 1;
}
.topbar-notif-wrap .notification-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  /* right: 0; */
  right: -109px;
  width: 460px;
  background: var(--bg-dropdown, var(--bg-secondary));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 200;
}
.topbar-notif-wrap .notification-list {
  max-height: calc(
    100dvh
    - var(--topbar-height, 3.5rem)
    - 4px          /* gap under bell (matches dropdown top) */
    - 3.25rem      /* .notification-dropdown-header */
    - -8px         /* bottom without breathing room */
  );
  overflow-y: auto;
}
.topbar-notif-wrap .notification-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.topbar-notif-count {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #ef4444;
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

.topbar-quick-actions {
  position: relative;
}

.topbar-quick-actions .quick-actions-menu {
  position: absolute;
  top: calc(100% + 15px);
  left: -47px;
  min-width: 180px;
  background: var(--bg-dropdown, var(--bg-secondary));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 0.35rem 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 210;
}

.topbar-quick-actions.open .quick-actions-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.topbar-quick-actions .quick-actions-item {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  text-align: left;
  padding: 0.5rem 0.75rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.topbar-quick-actions .quick-actions-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.topbar-quick-actions .quick-actions-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.3rem 0;
}

/* Inline-style replacements */
.topbar-search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 300;
}

.topbar-tenant-loading {
  padding: 0.75rem 0.85rem;
  font-size: 0.75rem;
}

.topbar-notif-btn {
  position: relative;
}

#tenantList .zel-tenant-item .zel-tenant-icon.zel-tenant-icon-lead {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-sm);
  background: rgba(31, 111, 235, 0.14);
  color: var(--accent-blue);
  font-size: 0.6rem;
  flex: 0 0 auto;
}

#tenantList .zel-tenant-item {
  padding: 0.34rem 0.45rem;
  gap: 0.45rem;
  border: 0;
  background: transparent;
  color: var(--text-primary);
}

#tenantList .zel-tenant-item:hover,
#tenantList .zel-tenant-item.active {
  background: var(--bg-tertiary);
}

#tenantList .zel-tenant-item-body {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 0.5rem;
}

#tenantList .zel-tenant-item-name {
  flex: 1;
  min-width: 0;
  text-align: left;
}

#tenantList .zel-tenant-item-id {
  flex-shrink: 0;
  text-align: right;
}

.topbar-notif-count[hidden],
.topbar-notif-count.is-hidden {
  display: none;
}

.live-shell-system-notice {
  position: fixed;
  top: 12px;
  left: 200px;
  right: 0;
  display: flex;
  justify-content: center;
  z-index: 9999;
  pointer-events: none;
}

.live-shell-system-notice__inner {
  max-width: 900px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgba(239, 68, 68, 0.95);
  color: #fff;
  font-weight: 600;
  text-align: center;
  pointer-events: auto;
}

.v2-recent-tickets-label {
  padding: 0.5rem 0.45rem 0.1rem 0.45rem;
}

.v2-recent-loading {
  display: block;
  padding: 0.25rem 0.45rem;
  color: var(--text-secondary);
  font-size: 0.72rem;
}

#recent-tickets-list,
#v2-recent-tickets-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 0.35rem;
  row-gap: 0.1rem;
  align-items: center;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0.1rem 0;
}

.v2-recent-ticket-item {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: subgrid;
  align-items: center;
  min-width: 0;
  padding: 0.12rem 0.45rem;
  border-radius: var(--radius-sm);
  color: inherit;
  text-decoration: none !important;
  transition: var(--transition);
  font-size: 0.82rem;
  line-height: 1.25;
}

.v2-recent-ticket-item:hover {
  background: rgba(31, 111, 235, 0.1);
  color: inherit;
}

@supports not (grid-template-columns: subgrid) {
  #recent-tickets-list,
  #v2-recent-tickets-list {
    display: block;
  }

  .v2-recent-ticket-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    grid-column: unset;
  }
}

.v2-recent-ticket-id {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
  cursor: pointer;
}

.v2-recent-ticket-row {
  display: contents;
}

.v2-recent-ticket-subject {
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
}

.v2-recent-ticket-item--title-only {
  display: block;
  overflow-x: hidden;
  overflow-y: visible;
  min-width: 0;
  line-height: 1.25;
  padding: 0.12rem 0.45rem;
}

.v2-recent-ticket-item--title-only .v2-recent-ticket-subject {
  display: block;
  font-weight: 400;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.25;
}

/* Mobile: show search icon when inline topbar search is hidden */
.zel-topbar-search-trigger {
  display: none;
}

@media (max-width: 767.98px) {
  .zel-topbar-search-trigger {
    display: inline-flex;
  }
}
