/* ============================================================
   KAYA – shared custom styles
   Loaded globally via base.html
   ============================================================ */

/* ── Filter pill bar ───────────────────────────────────────────
   Used on list/filter pages (employees, invites, etc.)
   ─────────────────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
}

.filter-pill-wrap { position: relative; }

.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .3rem .85rem;
  border: 1.5px solid #ced4da;
  border-radius: 999px;
  background: #fff;
  color: #495057;
  font-size: .85rem;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.4;
  transition: border-color .15s, background .15s;
  /* reset button defaults */
  appearance: none;
  -webkit-appearance: none;
}
.filter-pill:hover  { border-color: #86b7fe; background: #f8f9ff; }
.filter-pill.active { border-color: #0d6efd; background: #e7f0ff; color: #0d3b8f; }
.filter-pill .pill-arrow { font-size: .65rem; transition: transform .2s; }
.filter-pill.open   .pill-arrow { transform: rotate(180deg); }

.pill-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.3rem;
  height: 1.3rem;
  padding: 0 .3rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  background: #e9ecef;
  color: #495057;
  transition: background .15s, color .15s;
}
.filter-pill.active .pill-badge { background: #0d6efd; color: #fff; }

/* Dropdown panel */
.filter-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + .4rem);
  left: 0;
  z-index: 1060;
  min-width: 220px;
  max-width: min(320px, calc(100vw - 1.5rem));
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.13);
  overflow: hidden;
}
.filter-dropdown.show { display: block; }

/* On small screens: centre the dropdown at the bottom of viewport */
@media (max-width: 575.98px) {
  .filter-dropdown {
    position: fixed;
    left: 50% !important;
    top: auto !important;
    bottom: 1rem;
    transform: translateX(-50%);
    width: 92vw;
    max-width: 92vw;
    border-radius: .75rem;
  }
}

.filter-dd-body { max-height: 260px; overflow-y: auto; }

.filter-option {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem 1rem;
  cursor: pointer;
  font-size: .875rem;
  transition: background .1s;
}
.filter-option:hover { background: #f0f4ff; }
.filter-option input { display: none; }
.opt-label { flex: 1; }
.opt-check {
  width: 1.1rem;
  height: 1.1rem;
  flex-shrink: 0;
  border: 2px solid #ced4da;
  border-radius: .2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  color: transparent;
  transition: all .15s;
}
/* Checked state via adjacent-sibling selector */
.filter-option input:checked + .opt-label + .opt-check {
  background: #0d6efd;
  border-color: #0d6efd;
  color: #fff;
}

.filter-dd-footer {
  display: flex;
  gap: .5rem;
  padding: .55rem .75rem;
  border-top: 1px solid #dee2e6;
  background: #f8f9fa;
}
.filter-dd-footer .btn { flex: 1; font-size: .8rem; padding: .3rem .4rem; }
