html, body { height: 100%; }
body { min-height: 100vh; font-size: 1.0625rem; }
/* Full-height flex layout; default to page-level scrolling */
.page { height: 100vh; display: flex; flex-direction: column; overflow: auto; }
.page-wrapper { flex: 1 1 auto; display: flex; flex-direction: column; overflow: auto; }
.page-wrapper > .container-xl { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
/* global helper: clamp long multi-line text */
.line-clamp-6 {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  line-clamp: 6;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  line-clamp: 3;
  overflow: hidden;
}
/* icon sizing helpers */
.icon-lg { font-size: 1.25rem; line-height: 1; }
.icon-xl { font-size: 1.5rem; line-height: 1; }
/* prevent line breaks in icon groups */
.sentiment-icons,
.star-rate {
  display: inline-flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
  gap: 0.25rem;
}
/* theme-aware logo switching */
.logo-light { display: none; }
[data-bs-theme='light'] .logo-light { display: inline; }
[data-bs-theme='light'] .logo-dark { display: none; }
[data-bs-theme='dark'] .logo-dark { display: inline; }

/* Teams embedded mode: tighten spacing */
body.in-teams .page { height: 100vh; }
body.in-teams .page-wrapper > .container-xl { padding-top: 0.5rem; }

/* Active nav item underline for visibility (single line) */
.navbar .nav-link.active .nav-link-title {
  position: relative;
}

.navbar .nav-link.active .nav-link-title::after {
  content: "";
  position: absolute;
  left: 0.5rem;
  right: 0.5rem;
  bottom: -0.35rem;
  height: 2px;
  background-color: var(--tblr-primary);
  border-radius: 2px;
}

/* Compact breadcrumbs spacing */
.breadcrumbs-compact {
  margin-top: -1rem;   /* pull closer to the navbar */
  margin-bottom: 0.25rem;
}

/* Dropdown active item accent */
.dropdown-menu .dropdown-item.active {
  position: relative;
}

.dropdown-menu .dropdown-item.active::after {
  content: "";
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.35rem;
  height: 2px;
  background-color: var(--tblr-primary);
  opacity: 0.9;
  border-radius: 2px;
}

/* Compact Teams top bar */
.teams-topbar {
  position: sticky;
  top: 0;
  z-index: 1030; /* above content */
  background: var(--tblr-bg-surface);
  border-bottom: 1px solid var(--tblr-border-color);
  min-height: 44px;
  padding: 6px 0;
}
.teams-topbar .avatar { width: 26px; height: 26px; font-size: 12px; }
.teams-topbar .ti { font-size: 1.1rem; }
.teams-topbar .btn.btn-link { color: var(--tblr-secondary); }

/* Global Search Styles */
.search-result-item {
  transition: background-color 0.15s ease-in-out;
  cursor: pointer;
}

.search-result-item:hover,
.search-result-item.selected {
  background-color: var(--tblr-bg-surface-secondary);
}

.search-result-item:last-child {
  border-bottom: none !important;
}

.search-section:last-child .search-result-item:last-child {
  border-bottom-left-radius: 0.375rem;
  border-bottom-right-radius: 0.375rem;
}

.search-section .bg-light {
  background-color: var(--tblr-bg-surface-tertiary) !important;
}

[data-bs-theme='dark'] .search-section .bg-light {
  background-color: var(--tblr-bg-surface-secondary) !important;
}

/* Search input focus states */
#globalSearch:focus,
#globalSearchBrowser:focus {
  box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
  border-color: #86b7fe;
}

/* Search results dropdown positioning */
#searchResults,
#searchResultsBrowser {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border: 1px solid var(--tblr-border-color);
}

/* Highlight matching text */
mark {
  background-color: #fff3cd;
  color: #664d03;
  padding: 0.1em 0.2em;
  border-radius: 0.25rem;
}

[data-bs-theme='dark'] mark {
  background-color: #664d03;
  color: #fff3cd;
}

/* Loading spinner animation */
.ti-spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Clickable badge styles */
.cursor-pointer {
  cursor: pointer;
}

.badge.cursor-pointer:hover {
  opacity: 0.8;
  transform: translateY(-1px);
  transition: all 0.15s ease-in-out;
}

/* Markdown preview theme support */
#customerMessagePreview,
#escalationPreview,
#resolutionPreview {
  background-color: var(--tblr-bg-surface-secondary) !important;
  border-color: var(--tblr-border-color) !important;
  color: var(--tblr-body-color);
}

[data-bs-theme='dark'] #customerMessagePreview,
[data-bs-theme='dark'] #escalationPreview,
[data-bs-theme='dark'] #resolutionPreview {
  background-color: var(--tblr-bg-surface-tertiary) !important;
}

/* Markdown preview list spacing */
#customerMessagePreview ul,
#escalationPreview ul,
#resolutionPreview ul {
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
}

#customerMessagePreview li,
#escalationPreview li,
#resolutionPreview li {
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

#customerMessagePreview li:last-child,
#escalationPreview li:last-child,
#resolutionPreview li:last-child {
  margin-bottom: 0;
}

/* Customer badge styling */
.customer-badge {
  text-decoration: none !important;
  transition: all 0.15s ease-in-out;
}

.customer-badge:hover {
  opacity: 0.8;
  transform: translateY(-1px);
}
