/* Cohivly custom styles — layered on top of Tabler.io (loaded via CDN in layouts) */

/* ---------- Design tokens ---------- */
:root {
  --cohivly-radius-sm: 6px;
  --cohivly-radius: 10px;
  --cohivly-radius-lg: 16px;
  --cohivly-border: rgba(15, 23, 42, 0.08);
  --cohivly-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
  --cohivly-shadow: 0 6px 20px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.06);
  --cohivly-shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.14);
}

/* ---------- Base ---------- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
}

.page-body {
  background: var(--tblr-bg-surface-secondary, #f5f6fa);
}

/* Sticky footer: keeps the portal footer pinned to the bottom of the
   viewport on short pages, and pushed below content on tall ones. */
.page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.page-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

.page-body {
  flex: 1 1 auto;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(100, 110, 140, 0.25);
  border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 110, 140, 0.4);
}

/* ---------- Cards ---------- */
.card {
  border: 1px solid var(--cohivly-border);
  border-radius: var(--cohivly-radius);
  box-shadow: var(--cohivly-shadow-sm);
}

.card-header {
  border-bottom-color: var(--cohivly-border);
}

.card-footer {
  border-top-color: var(--cohivly-border);
}

.card-title {
  font-weight: 600;
  letter-spacing: -0.01em;
}

.card-link.hover-lift:hover {
  border-color: var(--tblr-primary);
}

/* ---------- Buttons ---------- */
.btn {
  border-radius: var(--cohivly-radius-sm);
  font-weight: 500;
  letter-spacing: -0.003em;
  transition: transform 0.1s ease, box-shadow 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn-primary {
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(32, 107, 196, 0.28);
}

.btn:active {
  transform: translateY(0);
}

/* ---------- Forms ---------- */
.form-control,
.form-select {
  border-radius: var(--cohivly-radius-sm);
  border-color: var(--cohivly-border);
}

.form-control:focus,
.form-select:focus {
  box-shadow: 0 0 0 3px rgba(32, 107, 196, 0.12);
}

.form-label {
  font-weight: 500;
  font-size: 0.8125rem;
}

/* ---------- Tables ---------- */
.table thead th {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--tblr-secondary);
}

.table-vcenter tbody tr {
  transition: background-color 0.1s ease;
}

.table-vcenter tbody tr:hover {
  background-color: var(--tblr-bg-surface-secondary, #f8f9fb);
}

/* Record detail view's label/value table: on a narrow screen a fixed
   220px label column leaves almost nothing for the value, so below the
   md breakpoint each row is stacked (label above value) instead of
   staying side-by-side. */
@media (max-width: 767.98px) {
  .cohivly-detail-table,
  .cohivly-detail-table tbody,
  .cohivly-detail-table tr,
  .cohivly-detail-table th,
  .cohivly-detail-table td {
    display: block;
    width: 100% !important;
  }

  .cohivly-detail-table tr {
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--cohivly-border);
  }

  .cohivly-detail-table tr:first-child {
    padding-top: 0;
  }

  .cohivly-detail-table tr:last-child {
    border-bottom: 0;
  }

  .cohivly-detail-table th,
  .cohivly-detail-table td {
    border: 0;
    padding: 0;
  }

  .cohivly-detail-table th {
    padding-bottom: 0.2rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--tblr-text-muted, #6c7a91);
  }
}

/* ---------- Dropdowns & modals ---------- */
.dropdown-menu {
  border-radius: var(--cohivly-radius-sm);
  border: 1px solid var(--cohivly-border);
  box-shadow: var(--cohivly-shadow);
  padding: 0.4rem;
}

.dropdown-menu .dropdown-item {
  border-radius: 6px;
}

.dropdown-menu .dropdown-item:hover,
.dropdown-menu .dropdown-item:focus {
  background-color: var(--tblr-bg-surface-secondary, #f4f6fb);
}

.modal-content {
  border-radius: var(--cohivly-radius);
  border: none;
  box-shadow: var(--cohivly-shadow-lg);
}

/* ---------- Badges, nav, pagination ---------- */
.badge {
  font-weight: 600;
  letter-spacing: 0.01em;
}

.page-title {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page-pretitle {
  letter-spacing: 0.06em;
}

.nav-tabs .nav-link {
  font-weight: 500;
}

.nav-link {
  font-weight: 500;
}

.pagination .page-link {
  border-radius: 6px;
  margin: 0 2px;
  border-color: var(--cohivly-border);
}

.list-group-item-action:hover {
  background-color: var(--tblr-bg-surface-secondary, #f8f9fb);
}

header.navbar.navbar-expand-md .container-xl,
header.navbar.navbar-expand-md .container-fluid {
  min-height: 54px;
  padding-top: 0;
  padding-bottom: 0;
}

header.navbar.navbar-expand-md {
  padding: 0;
}

.cohivly-header-divider {
  width: 1px;
  align-self: stretch;
  margin: 0.6rem 0;
  background: var(--cohivly-border);
}

/* Reused avatar/menu pattern (admin topbar, super admin topbar) */
.cohivly-user-avatar--on-dark {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.cohivly-user-toggle--on-dark:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Auth shell (admin + super admin login) */
.cohivly-auth-shell {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 10%, rgba(32, 107, 196, 0.12), transparent 40%),
    radial-gradient(circle at 85% 0%, rgba(32, 107, 196, 0.08), transparent 40%),
    var(--tblr-bg-surface-secondary, #f5f6fa);
}

.cohivly-auth-logo {
  height: 34px;
  width: auto;
  border-radius: var(--cohivly-radius);
}

.cohivly-auth-card-wrap .card {
  border-radius: var(--cohivly-radius-lg);
  box-shadow: var(--cohivly-shadow-lg);
}

.cohivly-auth-card {
  border-radius: var(--cohivly-radius-lg);
  box-shadow: var(--cohivly-shadow-lg);
}

/* Admin login split screen: form panel on the left, background image on the right */
.cohivly-admin-login-shell {
  min-height: 100vh;
}

.cohivly-admin-login-split {
  display: flex;
  min-height: 100vh;
}

.cohivly-admin-login-panel {
  flex: 0 0 480px;
  max-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tblr-bg-surface, #fff);
  padding: 2rem 1.5rem;
}

.cohivly-admin-login-panel-inner {
  width: 100%;
  max-width: 360px;
}

.cohivly-admin-login-panel .cohivly-auth-card {
  box-shadow: none;
  border: none;
}

.cohivly-admin-login-image {
  flex: 1 1 auto;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: var(--tblr-bg-surface-secondary, #f5f6fa);
}

@media (max-width: 992px) {
  .cohivly-admin-login-image {
    display: none;
  }

  .cohivly-admin-login-panel {
    flex: 1 1 auto;
  }
}

/* Icon-adorned inputs + password visibility toggle (admin + portal login) */
.input-icon {
  position: relative;
}

.input-icon > .form-control {
  padding-left: 2.5rem;
}

.input-icon > .input-icon-addon {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  color: var(--tblr-text-muted, #6c7a91);
  pointer-events: none;
}

.cohivly-input-icon-pwd > .form-control {
  padding-right: 2.5rem;
}

.input-icon .cohivly-password-toggle {
  left: auto;
  right: 0;
  pointer-events: auto;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: color 0.15s ease;
}

.input-icon .cohivly-password-toggle:hover,
.input-icon .cohivly-password-toggle.cohivly-password-toggle--active {
  color: var(--tblr-primary);
}

.cohivly-superadmin-badge {
  font-size: 0.65rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.cohivly-logo {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.cohivly-brand {
  padding: 1.25rem 1rem;
  margin-bottom: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.cohivly-sidebar-nav.pt-lg-3 {
  padding-top: 0.5rem !important;
}

.cohivly-logo-badge {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  border-radius: var(--cohivly-radius);
  padding: 5px 12px;
}

.cohivly-sidebar .cohivly-logo-badge {
  background: transparent;
  padding: 5px 0;
}

/* Tenant signup wizard */
.cohivly-auth-card-wrap--wide {
  max-width: 640px;
  margin: 0 auto;
}

.cohivly-signup-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.cohivly-signup-step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--tblr-text-muted, #6c7a91);
}

.cohivly-signup-step-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  background: var(--tblr-bg-surface-secondary, #f5f6fa);
  border: 1px solid var(--tblr-border-color, #e6e9ef);
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.cohivly-signup-step.is-active .cohivly-signup-step-dot {
  background: var(--tblr-primary);
  border-color: var(--tblr-primary);
  color: #fff;
}

.cohivly-signup-step.is-done .cohivly-signup-step-dot {
  background: var(--tblr-success, #2fb344);
  border-color: var(--tblr-success, #2fb344);
  color: #fff;
}

.cohivly-signup-step-label {
  font-size: 0.8rem;
  font-weight: 500;
  display: none;
}

@media (min-width: 576px) {
  .cohivly-signup-step-label {
    display: inline;
  }
}

.cohivly-signup-step.is-active .cohivly-signup-step-label {
  color: var(--tblr-body-color, #1c2434);
}

.cohivly-signup-step-connector {
  width: 1.5rem;
  height: 2px;
  background: var(--tblr-border-color, #e6e9ef);
  flex-shrink: 0;
}

.cohivly-signup-panel {
  display: none;
}

.cohivly-signup-panel.is-active {
  display: block;
}

.cohivly-slug-check {
  font-size: 0.8rem;
  margin-top: 0.35rem;
  min-height: 1.1rem;
}

.cohivly-slug-check.is-ok { color: var(--tblr-success, #2fb344); }
.cohivly-slug-check.is-bad { color: var(--tblr-danger, #d63939); }
.cohivly-slug-check.is-checking { color: var(--tblr-text-muted, #6c7a91); }

.cohivly-plan-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--tblr-bg-surface-secondary, #f5f6fa);
  border: 1px solid var(--tblr-border-color, #e6e9ef);
  border-radius: var(--cohivly-radius);
  padding: 0.75rem 1rem;
}

.cohivly-plan-badge-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cohivly-plan-badge-name {
  font-weight: 600;
}

.cohivly-plan-badge-price {
  font-size: 0.8rem;
  color: var(--tblr-text-muted, #6c7a91);
}

.cohivly-plan-badge-free {
  flex-shrink: 0;
  font-weight: 600;
}

.cohivly-logo-img {
  height: 38px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

.cohivly-user-toggle {
  border-radius: 8px;
  padding: 0.3rem 0.6rem 0.3rem 0.3rem;
  transition: background-color 0.15s ease;
}

.cohivly-user-toggle:hover {
  background: var(--tblr-bg-surface-secondary, #f4f6fb);
}

.cohivly-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tblr-primary-lt);
  color: var(--tblr-primary);
  font-weight: 600;
  font-size: 0.8rem;
  flex-shrink: 0;
}

.cohivly-user-caret {
  width: 16px;
  height: 16px;
}

.cohivly-dropdown-icon {
  width: 18px;
  height: 18px;
}

.facet-panel .form-check {
  margin-bottom: 0.25rem;
}

/* A collapsible facet box (<details>/<summary>) — the summary already
   shows a native disclosure marker in most browsers, but it's small and
   easy to miss next to a card-header's other content, so this swaps it
   for an explicit chevron that both signals "click to expand/collapse"
   and shows current state (rotates to point down once open). */
.facet-collapsible > summary {
  cursor: pointer;
  list-style: none;
}

.facet-collapsible > summary::-webkit-details-marker {
  display: none;
}

.facet-collapsible > summary::marker {
  content: '';
}

.facet-collapse-chevron {
  display: inline-flex;
  transition: transform 0.15s ease;
}

.facet-collapsible[open] > summary .facet-collapse-chevron {
  transform: rotate(90deg);
}

/* Dual-handle year-range slider for a date facet: two native range inputs
   stacked on the same track. Each input's own invisible full-width track
   is pointer-events:none so only its thumb is clickable/draggable — the
   standard technique for faking a dual-handle slider out of two single
   ones without a JS slider library. */
.date-facet-slider-track {
  position: relative;
  height: 1.5rem;
}

.date-facet-slider-track::before {
  content: '';
  position: absolute;
  top: 0.65rem;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--tblr-border-color, #dce1e7);
}

.date-facet-slider-fill {
  position: absolute;
  top: 0.65rem;
  height: 4px;
  border-radius: 2px;
  background: var(--tblr-primary, #206bc4);
}

.date-facet-range {
  position: absolute;
  top: 0.4rem;
  left: 0;
  width: 100%;
  margin: 0;
  pointer-events: none;
  background: transparent;
}

.date-facet-range::-webkit-slider-thumb {
  pointer-events: auto;
}

.date-facet-range::-moz-range-thumb {
  pointer-events: auto;
}

.date-facet-range::-webkit-slider-runnable-track {
  background: transparent;
}

.date-facet-range::-moz-range-track {
  background: transparent;
}

.field-settings-row {
  border-top: 1px solid var(--tblr-border-color);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
}

/* Tom Select's default z-index sits below Tabler's sidebar/navbar, so the
   list-field dropdown renders behind them instead of on top. Raising the
   z-index alone leaves it with a transparent background (its own theme CSS
   sets one via a Bootstrap variable Tabler doesn't define) — and since that
   theme stylesheet is linked *after* app.css in the page markup, it wins
   the cascade at equal specificity, so these need !important to stick. */
.ts-dropdown {
  z-index: 1055 !important;
  background-color: var(--tblr-bg-surface, #fff) !important;
  border: 1px solid var(--tblr-border-color, rgba(0, 0, 0, 0.15)) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

.related-tree-svg {
  width: 100%;
  height: auto;
  background: var(--tblr-bg-surface);
  border: 1px solid var(--tblr-border-color);
  border-radius: 4px;
}

.record-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
}

.badge-field-type {
  text-transform: uppercase;
  font-size: 0.65rem;
  letter-spacing: 0.03em;
}

.sidebar-section-label {
  text-transform: uppercase;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.35);
  padding: 1rem 1rem 0.35rem;
  font-weight: 600;
}

.navbar-vertical .nav-item.active > .nav-link {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  box-shadow: inset 2px 0 0 var(--tblr-primary, #206bc4);
}

.navbar-vertical .nav-link {
  border-radius: 6px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.navbar-vertical .nav-link:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.navbar-vertical .dropdown-menu .dropdown-item {
  border-radius: 6px;
  padding: 0.4rem 0.75rem;
}

.navbar-vertical .dropdown-menu .dropdown-item.active,
.navbar-vertical .dropdown-menu .dropdown-item:active {
  background: var(--tblr-primary, #206bc4);
  color: #fff;
}

.navbar-vertical .nav-link .icon {
  width: 20px;
  height: 20px;
}

/* ---------- Sidebar: pinned tenant footer ---------- */
.cohivly-sidebar {
  display: flex;
  flex-direction: column;
}

.cohivly-sidebar-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

@media (min-width: 992px) {
  .cohivly-sidebar-collapse {
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  .cohivly-sidebar-nav {
    flex: 1 1 auto;
    overflow-y: auto;
    padding-bottom: 0.5rem;
  }
}

.cohivly-sidebar-section-title {
  margin-top: 0.6rem;
  padding: 0.6rem 1rem 0.35rem;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.cohivly-sidebar-section-title:first-of-type {
  margin-top: 0.25rem;
  padding-top: 0;
  border-top: none;
}

.cohivly-quick-action .nav-link-icon {
  color: #74c0fc;
}

.nav-item.active > .cohivly-quick-action .nav-link-icon {
  color: #fff;
}

.cohivly-sidebar-footer {
  flex-shrink: 0;
  padding: 0.85rem 1rem;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.cohivly-tenant-badge {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  border-radius: 6px;
  padding: 0.25rem 0.35rem;
  margin: -0.25rem -0.35rem;
  transition: background-color 0.15s ease;
}

.cohivly-tenant-badge:hover {
  background-color: rgba(255, 255, 255, 0.08);
}

.cohivly-tenant-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tblr-primary, #206bc4);
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(32, 108, 196, 0.25);
}

.cohivly-tenant-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.navbar-expand-md.navbar {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.stat-card {
  border-left: 3px solid var(--tblr-primary);
}

.stat-card .icon-wrap {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--tblr-primary-lt);
  color: var(--tblr-primary);
}

.empty-state {
  padding: 3rem 1.5rem;
  text-align: center;
  color: var(--tblr-secondary);
}

.empty-state .icon {
  width: 42px;
  height: 42px;
  opacity: 0.5;
  margin-bottom: 0.5rem;
}

.hover-lift {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.folder-tree-body {
  max-height: 520px;
  overflow-y: auto;
}

.folder-tree,
.folder-tree ul {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.folder-tree ul {
  padding-left: 1.15rem;
  border-left: 1px dashed var(--tblr-border-color);
  margin-left: 0.55rem;
}

.folder-tree-item {
  margin: 0.1rem 0;
}

.folder-tree-row {
  display: flex;
  align-items: flex-start;
  gap: 0.25rem;
}

.folder-tree-row > details {
  flex: 1;
  min-width: 0;
}

.folder-tree summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.25rem;
  border-radius: 4px;
}

.folder-tree summary:hover {
  background: var(--tblr-bg-surface-secondary, #f7f8fa);
}

.folder-tree summary::-webkit-details-marker {
  display: none;
}

.folder-tree summary::marker {
  content: '';
}

.folder-tree-caret {
  display: inline-block;
  width: 0;
  height: 0;
  flex-shrink: 0;
  margin: 0 2px;
  border-style: solid;
  border-width: 4px 0 4px 5px;
  border-color: transparent transparent transparent var(--tblr-secondary);
  transition: transform 0.12s ease;
}

details[open] > summary > .folder-tree-caret {
  transform: rotate(90deg);
}

.folder-tree-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--tblr-secondary);
}

.folder-tree-caret-spacer {
  display: inline-block;
  width: 9px;
  flex-shrink: 0;
}

.folder-tree-leaf {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.25rem 0.15rem 1.75rem;
}

.folder-tree-item--current > .folder-tree-row > details > summary,
.folder-tree-item--current > .folder-tree-leaf {
  background: var(--tblr-primary-lt);
  font-weight: 600;
  border-radius: 4px;
}

.folder-tree-unrelate {
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.folder-tree-row:hover > .folder-tree-unrelate,
.folder-tree-row:focus-within > .folder-tree-unrelate,
.folder-tree-leaf:hover > .folder-tree-unrelate,
.folder-tree-leaf:focus-within > .folder-tree-unrelate {
  opacity: 1;
}

.folder-tree-unrelate .btn {
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 1;
  border: none;
}

.folder-tree-unrelate .btn:hover {
  background: var(--tblr-danger-lt);
  color: var(--tblr-danger);
}

.folder-tree-unrelate-icon {
  width: 14px;
  height: 14px;
}

@media (hover: none) {
  .folder-tree-unrelate {
    opacity: 1;
  }
}

.folder-tree-relate-results {
  display: none;
  position: absolute;
  z-index: 20;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 220px;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  border-radius: 0 0 4px 4px;
  background: white;
}

.alert {
  background-color: white;
}

/* ---------- Page loading indicator ---------- */
.cohivly-page-loader {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px;
  width: 0;
  background: linear-gradient(90deg, var(--tblr-primary, #206bc4), #79c0ff, var(--tblr-primary, #206bc4));
  background-size: 200% 100%;
  box-shadow: 0 0 8px rgba(32, 107, 196, 0.7), 0 1px 3px rgba(0, 0, 0, 0.3);
  z-index: 2000;
  opacity: 0;
  transition: width 0.3s ease-out, opacity 0.2s ease-out;
  pointer-events: none;
}

.cohivly-page-loader.is-active {
  opacity: 1;
  animation: cohivly-page-loader-shimmer 1s linear infinite;
}

@keyframes cohivly-page-loader-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

html.cohivly-is-loading,
html.cohivly-is-loading * {
  cursor: progress !important;
}

/* ---------- Admin header quick search ---------- */
.cohivly-quicksearch {
  position: relative;
  width: 320px;
}

.cohivly-quicksearch .input-icon > .form-control {
  padding-right: 3.4rem;
}

.cohivly-quicksearch-hint {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0.5rem;
  display: flex;
  align-items: center;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--tblr-text-muted, #6c7a91);
  background: var(--tblr-bg-surface-secondary, #f5f6fa);
  border: 1px solid var(--cohivly-border);
  border-radius: var(--cohivly-radius-sm);
  padding: 0.05rem 0.35rem;
  pointer-events: none;
}

.cohivly-quicksearch.is-loading .cohivly-quicksearch-hint {
  opacity: 0.4;
}

.cohivly-quicksearch-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 420px;
  max-width: 80vw;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--tblr-bg-surface, #fff);
  border: 1px solid var(--cohivly-border);
  border-radius: var(--cohivly-radius);
  box-shadow: var(--cohivly-shadow-lg);
  padding: 0.4rem;
  z-index: 1030;
}

.cohivly-quicksearch-group + .cohivly-quicksearch-group {
  margin-top: 0.25rem;
  padding-top: 0.4rem;
  border-top: 1px solid var(--cohivly-border);
}

.cohivly-quicksearch-group-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tblr-text-muted, #6c7a91);
  padding: 0.3rem 0.6rem 0.2rem;
}

.cohivly-quicksearch-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--cohivly-radius-sm);
  color: inherit;
  text-decoration: none;
}

.cohivly-quicksearch-item:hover,
.cohivly-quicksearch-item.is-active {
  background-color: var(--tblr-bg-surface-secondary, #f4f6fb);
  color: inherit;
}

.cohivly-quicksearch-item-iconwrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: var(--cohivly-radius-sm);
  background: var(--tblr-bg-surface-secondary, #f5f6fa);
  color: var(--tblr-text-muted, #6c7a91);
}

.cohivly-quicksearch-item-iconwrap .icon {
  width: 16px;
  height: 16px;
}

.cohivly-quicksearch-item-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.cohivly-quicksearch-item-label {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cohivly-quicksearch-item-desc {
  font-size: 0.75rem;
  color: var(--tblr-text-muted, #6c7a91);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cohivly-notif-toggle {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  transition: background-color 0.15s ease;
}

.cohivly-notif-toggle:hover {
  background: var(--tblr-bg-surface-secondary, #f4f6fb);
}

.cohivly-notif-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--tblr-danger, #d63939);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  line-height: 16px;
  text-align: center;
}

.cohivly-notif-menu {
  width: 380px;
  max-width: 90vw;
  padding: 0.4rem 0;
}

.cohivly-notif-header {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tblr-text-muted, #6c7a91);
  padding: 0.2rem 0.85rem 0.5rem;
}

.cohivly-notif-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 0 0.4rem;
}

.cohivly-notif-empty {
  padding: 1rem 0.5rem;
  font-size: 0.8125rem;
  color: var(--tblr-text-muted, #6c7a91);
  text-align: center;
}

.cohivly-notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.4rem;
  border-radius: var(--cohivly-radius-sm);
  color: inherit;
  text-decoration: none;
}

a.cohivly-notif-item:hover {
  background-color: var(--tblr-bg-surface-secondary, #f4f6fb);
  color: inherit;
}

.cohivly-notif-item-iconwrap {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: var(--cohivly-radius-sm);
}

.cohivly-notif-item-iconwrap .icon {
  width: 16px;
  height: 16px;
}

.cohivly-notif-item-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.cohivly-notif-item-title {
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cohivly-notif-item-detail {
  font-size: 0.75rem;
  color: var(--tblr-text-muted, #6c7a91);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cohivly-notif-item-meta {
  font-size: 0.6875rem;
  color: var(--tblr-text-muted, #6c7a91);
  margin-top: 0.1rem;
}

.cohivly-quicksearch-empty {
  padding: 0.75rem 0.6rem;
  font-size: 0.8125rem;
  color: var(--tblr-text-muted, #6c7a91);
}

@media (max-width: 991.98px) {
  .cohivly-quicksearch {
    width: 220px;
  }
}

/* Upload badge glow — flags which attached document a keyword search
   actually matched inside (see SearchService::matchedUploadFieldValueIds()
   and views/{admin,portal}/records/view.php). */
.upload-badge-match {
  box-shadow: 0 0 0 2px #f5c518, 0 0 8px 2px rgba(245, 197, 24, 0.75);
}

.tabed-card {
  border-radius: 0px 0px 10px 10px;
}