:root {
  --navbar-h: 5px;
  --gap: 2px;
  --ctl-h: 36px;
  --seg-pad-y: 5px;
  --seg-pad-x: 6px;
  --seg-rad: 10px;

  --bars-rail-bg: #f3f4f6;

  --color-border: #e5e7eb;
  --color-bg-card: #ffffff;
  --color-text: #111827;
  --color-muted: #6b7280;
  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
}

/* old sticky bar (if present) hide completely */
.function-bars{
  display:none !important;
  height:0 !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
}

/* page gutters */
.leads-page {
  padding: 0;
}

/* TOPBAR – 3 segments */
.topbar-three {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr;  /* actions | bulk | filters */
  gap: .6rem;
  align-items: center;
  margin-bottom: .9rem;
}

.topbar-three .seg {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .75rem;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

/* Distinct backgrounds */
.topbar-three .seg-actions {
  background: #f1f5ff;
  border: 1px solid #d4dffc;
}

.topbar-three .seg-bulk {
  background: #fef6e4;
  border: 1px solid #f9e2ae;
}

.topbar-three .seg-filters {
  background: #f3f6f8;
  border: 1px solid #e1e5e8;
}

/* bulk segment: select-all at end */
.topbar-three .seg-bulk .select-all {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* control sizing */
.topbar-three .btn {
  min-height: 34px;
  border-radius: 8px;
  font-size: .9rem;
  padding: .35rem .8rem;
}
.topbar-three .form-select {
  min-height: 34px;
  border-radius: 8px;
  font-size: .9rem;
  padding: .25rem 2rem .25rem .6rem;
  width: auto;
}

/* Keep selects compact */
#timebondSel { min-width: 120px; }
#userbondSel { min-width: 180px; }
#viewSel     { min-width: 120px; }
#assignUserSel { min-width: 180px; }

/* mobile: stack 3 rows */
@media (max-width: 992px) {
  .topbar-three {
    grid-template-columns: 1fr;
  }
  .topbar-three .seg {
    justify-content: center;
    flex-wrap: wrap;
  }
  .topbar-three .seg-bulk .select-all {
    margin-left: 0;
  }
}

/* hide select-all on very small screens if needed */
@media (max-width: 575.98px) {
  .topbar-three .seg-bulk .select-all {
    display: none !important;
  }
}

/* STATUS STRIP */
.status-wrap {
  display: grid;
  gap: .5rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: .75rem;
}

/* Desktop: one line, no scroll; equal widths */
@media (min-width: 992px) {
  .status-wrap {
    display: flex !important;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: .4rem;
    overflow: visible !important;
    padding-bottom: 0;
  }
  .status-wrap .status-badge {
    flex: 1 1 0;
    min-width: 0;
  }
}

.status-badge {
  height: var(--ctl-h);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0 .9rem;
  background: var(--color-bg-card);
  color: var(--color-text);
  white-space: nowrap;
  text-decoration: none;
  transition: all .18s ease;
}

.status-badge:hover {
  background: color-mix(in srgb, var(--color-bg-card) 88%, var(--color-text) 12%);
  border-color: color-mix(in srgb, var(--color-border) 70%, var(--color-text));
  transform: translateY(-1px);
}


.status-badge.active {
  background: var(--color-primary);
  color: #fff !important;
  border-color: var(--color-primary-hover);
}

/* inner layout */
.status-badge .sb-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  min-width: 0;
  width: 100%;
}

.status-badge .sb-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: clamp(12px, .9vw, 14px);
  max-width: 100%;
}

.status-badge .sb-count {
  font-weight: 700;
  opacity: .85;
  font-size: clamp(12px, .9vw, 14px);
}

.status-badge .sb-new {
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  padding: .1rem .45rem;
  font-size: 11px;
  line-height: 1;
}

/* Mid-desktop: use data-short labels */
@media (min-width: 992px) and (max-width: 1399.98px) {
  .status-badge .sb-label {
    color: transparent;
    position: relative;
  }
  .status-badge .sb-label::after {
    content: attr(data-short);
    position: absolute;
    inset: 0;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .status-wrap { gap: .32rem; }
  .status-wrap .status-badge { padding: 0 .5rem; }
  .status-badge .sb-count { font-size: 12px; }
}

/* Very wide screens: roomy */
@media (min-width: 1400px) {
  .status-wrap .status-badge {
    height: 36px;
    padding: 0 .9rem;
  }
  .status-badge .sb-label { font-size: 14px; }
  .status-badge .sb-count { font-size: 14px; }
}

/* pagination */
.pager-wrap {
  display: flex;
  gap: .5rem;
  align-items: center;
  justify-content: center;
  margin: 12px 0;
  flex-wrap: wrap;
}

.pager-btn {
  display: inline-block;
  padding: .35rem .7rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-bg-card);
  text-decoration: none;
  font-size: .9rem;
}

.pager-btn[aria-disabled="true"] {
  opacity: .5;
  pointer-events: none;
}

.pager-page {
  padding: .2rem .55rem;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: .9rem;
}

.pager-page.active {
  border-color: var(--color-primary);
  background: color-mix(in srgb, #fff 88%, var(--color-primary) 12%);
}

/* bulk actions under table */
.bulk-actions {
  margin-top: .25rem;
}

/* scroll margin for highlight row */
[id^="lead-"] {
  scroll-margin-top: 96px;
}
