.b-example-divider {
  width: 100%;
  height: 3rem;
  background-color: #0000001a;
  border: solid rgba(0, 0, 0, 0.15);
  border-width: 1px 0;
  box-shadow: inset 0 0.5em 1.5em #0000001a,
              inset 0 0.125em 0.5em #00000026;
}

.b-example-vr {
  flex-shrink: 0;
  width: 0;
  height: 100vh;
}

.bi {
  vertical-align: -0.125em;
  fill: currentColor;
}

/* Ensure body fills viewport and works with flex column */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: -webkit-fill-available;
}

/* Main container: sidebar + content */
main {
  flex: 1 1 auto;        /* fill remaining vertical space */
  display: flex;         /* row: sidebar + content */
  min-height: 0;         /* prevents flex children from overflowing */
  overflow: hidden;      /* prevent body scrollbars */
}

/* Sidebar */
.db-sidebar {
  width: 280px;
  flex-shrink: 0;
  overflow-y: auto;      /* scroll independently if too tall */
}

/* Content area */
main > .flex-grow-1 {
  min-width: 0;          /* prevent flex overflow */
  overflow-y: auto;      /* scrolls vertically */
  overflow-x: hidden;
}

/* Dropdowns */
.dropdown-toggle {
  outline: 0;
}

/* Toggle buttons */
.btn-toggle {
  padding: 0.25rem 0.5rem;
  font-weight: 600;
  color: var(--bs-emphasis-color);
  background-color: transparent;
}
.btn-toggle:hover,
.btn-toggle:focus {
  color: rgba(var(--bs-emphasis-color-rgb), 0.85);
  background-color: var(--bs-tertiary-bg);
}

.btn-toggle::before {
  width: 1.25em;
  line-height: 0;
  content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%280,0,0,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
  transition: transform 0.35s ease;
  transform-origin: 0.5em 50%;
}

[data-bs-theme="dark"] .btn-toggle::before {
  content: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='rgba%28255,255,255,.5%29' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 14l6-6-6-6'/%3e%3c/svg%3e");
}

.btn-toggle[aria-expanded="true"] {
  color: rgba(var(--bs-emphasis-color-rgb), 0.85);
}
.btn-toggle[aria-expanded="true"]::before {
  transform: rotate(90deg);
}

.btn-toggle-nav a {
  padding: 0.1875rem 0.5rem;
  margin-top: 0.125rem;
  margin-left: 1.25rem;
}
.btn-toggle-nav a:hover,
.btn-toggle-nav a:focus {
  background-color: var(--bs-tertiary-bg);
}

.scrollarea {
  overflow-y: auto;
}

/* Sidebar avatar + logo */
.db-avatar {
  width: 40px;
  height: 40px;
}

.avatar-stack {
  display: flex;
}
.avatar-stack > * {
  margin-left: -8px;
  box-shadow: 0 0 0 1px #fff;
}
.avatar-stack > *:first-child {
  margin-left: 0;
}

.db-sidebar-logo {
  width: 40px;
  height: 32px;
}

/* Notification badge */
.db-unread-badge {
  display: none;
  font-size: 0.65rem;
}

/* Paper ratio utility */
.ratio-paper {
  aspect-ratio: 8.5 / 11;
  width: min(100%, calc(8.5 / 11 * 100vh));
  height: auto;
  max-width: 100%;
  max-height: 100%;
}

.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 26px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #dee2e6; /* Bootstrap gray-200 */
}

.timeline-item {
  position: relative;
}

.timeline-dot {
  flex-shrink: 0;
  margin-top: 4px;
  width:14px;
  height:14px;
}

/* --- Fix Bootstrap popovers / dropdowns hidden by bootstrap-table --- */
.fixed-table-body {
  overflow: visible !important;       /* allow popovers, dropdowns to escape */
}

.popover,
.tooltip {
  z-index: 3000 !important;           /* keep above table and modals */
}

/* optional: ensure scrollbars still appear properly */
.fixed-table-container {
  position: relative;
}

.fixed-table-toolbar .bs-bars {
  float: none !important;
  width: 100%;
}

/* Document title auto-fill animation */
.title-auto-filled {
  animation: highlight-fill 0.5s ease-out;
  background-color: rgba(13, 110, 253, 0.1); /* Bootstrap primary with opacity */
}

@keyframes highlight-fill {
  0% { background-color: rgba(13, 110, 253, 0.2); }
  100% { background-color: transparent; }
}

[data-action="toggle-follow"]:hover i {
  opacity: 0.7;
  transform: scale(1.1);
}

.message-collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 2;   /* show first 2 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.message-expanded {
  display: block;
}
.message-toggle {
  cursor: pointer;
  font-size: 0.85rem;
}

.db-message.message-collapsed {
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}

/* --- Typography utilities --- */
.font-sm {
  font-size: .875em;
}

.text-xs {
  font-size: 0.7rem;
}

.text-xxs {
  font-size: 0.8rem;
}

/* --- Avatar utilities --- */
.avatar-md {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
}

/* --- Badge utilities --- */
.badge-fixed-70 {
  width: 70px;
}

.badge-padding {
  padding: 0.3rem 0.45rem;
}

/* --- Border utilities --- */
.border-left-gray {
  border-color: #e5e7eb !important;
  border-width: 2px !important;
}

/* --- Divider utilities --- */
.vr-sm {
  height: 24px;
}

/* --- Search container --- */
.search-container {
  min-width: 220px;
  max-width: 320px;
}