/* Family guard: a change to one account checks its family first */

.bbi-fg-cols {
  position: absolute;
  top: 60px;
  left: 14px;
  right: 14px;
  height: 24px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bbi-muted);
}

.bbi-fg-cols span { position: absolute; top: 4px; }
.bbi-fg-cols span:nth-child(1) { left: 12px; }
.bbi-fg-cols span:nth-child(2) { left: 330px; width: 80px; text-align: right; }
.bbi-fg-cols span:nth-child(3) { left: 452px; }

/* ---------- Rows ---------- */

.bbi-fg-row {
  position: absolute;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border-radius: 12px;
  background: #fff;
  transition: opacity 0.45s ease, background-color 0.45s ease, box-shadow 0.45s ease;
}

.bbi-fg-row::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -3px;
  height: 1px;
  background: var(--bbi-line);
}

.bbi-fg-row.is-fam::after { left: 50px; }
.bbi-fg-row:nth-last-child(1)::after { display: none; }

.bbi-fg-row__tile {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 8px;
  background: var(--bbi-surface-2);
  color: var(--bbi-muted);
  transition: background-color 0.4s ease, color 0.4s ease;
}

.bbi-fg-row__tile svg { width: 15px; height: 15px; }
.bbi-fg-row__tile.is-parent { background: linear-gradient(135deg, #344767, #1e2a4a); color: #fff; }
.bbi-fg-row__tile--pink { background: #ffe3ee; color: #e0115f; }
.bbi-fg-row__tile--teal { background: #dcf6f3; color: #0b8aa3; }

.bbi-fg-row__name { min-width: 0; }

.bbi-fg-row__name b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--bbi-ink);
  white-space: nowrap;
}

.bbi-fg-row__name small {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--bbi-muted);
}

/* The users icon the Account List shows beside family accounts */
.bbi-fg-fam {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  flex: none;
  border-radius: 999px;
  background: var(--bbi-surface-2);
  color: var(--bbi-muted);
  font-size: 11px;
  font-weight: 800;
  transition: background-color 0.35s ease, color 0.35s ease;
}

.bbi-fg-fam svg { width: 13px; height: 13px; }

.bbi-fg-row__arr {
  position: absolute;
  left: 330px;
  width: 80px;
  text-align: right;
  font-size: 13px;
  font-weight: 700;
  color: var(--bbi-ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- Owner cell (Account Executive) ---------- */

.bbi-fg-owner {
  position: absolute;
  top: 3px;
  left: 452px;
  width: 228px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 10px 0 5px;
  border-radius: 11px;
  transition: background-color 0.4s ease, box-shadow 0.3s ease, transform 0.2s var(--bbi-ease);
}

.bbi-fg-owner .bbi-avatar { width: 28px; height: 28px; box-shadow: none; }
.bbi-fg-owner__text { min-width: 0; line-height: 1.15; }
.bbi-fg-owner__text b { display: block; font-size: 13px; font-weight: 800; color: var(--bbi-ink); white-space: nowrap; }
.bbi-fg-owner__text small { display: block; font-size: 11px; font-weight: 700; white-space: nowrap; }
.bbi-fg-owner__caret { margin-left: auto; color: var(--bbi-muted); opacity: 0.7; }
.bbi-fg-owner__caret svg { width: 14px; height: 14px; display: block; }

.bbi-fg-owner.is-maya { background: rgba(94, 114, 228, 0.09); }
.bbi-fg-owner.is-maya small { color: var(--bbi-indigo); }
.bbi-fg-owner.is-diego { background: rgba(17, 167, 196, 0.11); }
.bbi-fg-owner.is-diego small { color: #0b8aa3; }
.bbi-fg-owner.is-priya { background: rgba(252, 95, 8, 0.08); }
.bbi-fg-owner.is-priya small { color: #c2410c; }
.bbi-fg-owner.is-pressed { transform: scale(0.97); }

.bbi-fg-list .bbi-fg-row.is-focus.is-pending { background: #f3f0ff; box-shadow: inset 4px 0 0 var(--bbi-purple); }
.bbi-fg-row.is-pending .bbi-fg-owner { box-shadow: 0 0 0 2px rgba(130, 94, 228, 0.45); }

/* ---------- Family check ---------- */

.bbi-fg-outline {
  position: absolute;
  z-index: 0;
  overflow: visible;
  pointer-events: none;
}

.bbi-fg-outline path {
  fill: rgba(130, 94, 228, 0);
  stroke: var(--bbi-purple);
  stroke-width: 2;
  opacity: 0;
  transition: fill 0.5s ease, stroke 0.5s ease;
}

.bbi-fg-list.is-checking .bbi-fg-outline path,
.bbi-fg-list.is-moved .bbi-fg-outline path { opacity: 1; }

.bbi-fg-list.is-checking .bbi-fg-outline path { fill: rgba(130, 94, 228, 0.05); }
.bbi-fg-list.is-moved .bbi-fg-outline path { stroke: var(--bbi-good); fill: rgba(26, 174, 111, 0.05); }

.bbi-fg-list.is-checking .bbi-fg-row:not(.is-fam) { opacity: 0.4; }
.bbi-fg-list.is-checking .bbi-fg-row.is-fam,
.bbi-fg-list.is-moved .bbi-fg-row.is-fam { background: transparent; }

.bbi-fg-row.is-found .bbi-fg-fam,
.bbi-fg-list.is-checking .bbi-fg-fam { background: rgba(130, 94, 228, 0.14); color: var(--bbi-purple); }
.bbi-fg-list.is-moved .bbi-fg-fam { background: var(--bbi-good-bg); color: var(--bbi-good); }

.bbi-fg-famlabel {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 24px;
  padding: 0 11px 0 9px;
  border-radius: 999px;
  background: var(--bbi-grad-brand);
  box-shadow: 0 8px 16px -8px rgba(94, 114, 228, 0.6);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(4px) scale(0.92);
  transition: opacity 0.35s ease, transform 0.45s var(--bbi-spring), background 0.4s ease;
}

.bbi-fg-famlabel b { font-weight: 800; }
.bbi-fg-famlabel svg { width: 14px; height: 14px; flex: none; }
.bbi-fg-famlabel.is-on { opacity: 1; transform: none; }
.bbi-fg-list.is-moved .bbi-fg-famlabel { background: var(--bbi-grad-good); box-shadow: 0 8px 16px -8px rgba(26, 174, 111, 0.6); }

.bbi-fg-row.is-flash { animation: bbi-fg-flash 1s ease; }

@keyframes bbi-fg-flash {
  0% { background-color: rgba(17, 167, 196, 0.16); }
  100% { background-color: transparent; }
}

/* ---------- Territory dropdown ---------- */

.bbi-fg-dd {
  position: absolute;
  z-index: 25;
  padding: 6px;
  border-radius: 14px;
  opacity: 0;
  transform: translateY(-6px) scale(0.97);
  transform-origin: top left;
  transition: opacity 0.22s ease, transform 0.35s var(--bbi-spring);
  pointer-events: none;
}

.bbi-fg-dd.is-open { opacity: 1; transform: none; }

.bbi-fg-dd__item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px 0 6px;
  border-radius: 10px;
  transition: background-color 0.2s ease;
}

.bbi-fg-dd__item .bbi-avatar { width: 28px; height: 28px; box-shadow: none; }
.bbi-fg-dd__item b { display: block; font-size: 13px; font-weight: 800; color: var(--bbi-ink); line-height: 1.15; white-space: nowrap; }
.bbi-fg-dd__item small { display: block; font-size: 11px; font-weight: 700; color: var(--bbi-muted); }
.bbi-fg-dd__item.is-hover { background: rgba(17, 167, 196, 0.12); }
.bbi-fg-dd__cur { margin-left: auto; color: var(--bbi-indigo); }
.bbi-fg-dd__cur svg { width: 14px; height: 14px; display: block; }

.bbi-fg-dd__sep {
  margin: 4px 8px 2px;
  padding-top: 8px;
  border-top: 1px solid var(--bbi-line);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bbi-muted);
}

.bbi-fg-dd__sys { height: 34px; color: var(--bbi-muted); }
.bbi-fg-dd__sys svg { width: 16px; height: 16px; margin: 0 6px; }
.bbi-fg-dd__sys b { color: var(--bbi-muted); font-weight: 700; }

/* ---------- Confirmation dialog ---------- */

.bbi-fg-dialog {
  z-index: 30;
  opacity: 0;
  transform: translateX(18px) scale(0.97);
  transition: opacity 0.3s ease, transform 0.5s var(--bbi-spring);
  pointer-events: none;
}

.bbi-fg-dialog.is-open { opacity: 1; transform: none; }

.bbi-fg-dialog__head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 17px 18px 12px;
  font-size: 15px;
  font-weight: 800;
  color: var(--bbi-ink);
  white-space: nowrap;
}

.bbi-fg-dialog__head svg { width: 18px; height: 18px; flex: none; color: var(--bbi-indigo); }

.bbi-fg-warn {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0 18px;
  padding: 9px 12px;
  border-radius: 11px;
  background: #fff4e5;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  color: #9a5b00;
}

.bbi-fg-warn svg { width: 15px; height: 15px; flex: none; margin-top: 1px; }

.bbi-fg-acct {
  margin: 12px 18px 0;
  border-radius: 14px;
  border: 1.5px solid #ffd28a;
  overflow: hidden;
}

.bbi-fg-acct__band {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  background: var(--bbi-grad-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.bbi-fg-acct__band svg { width: 16px; height: 16px; }
.bbi-fg-acct__body { padding: 12px 14px 10px; }

.bbi-fg-facts { display: flex; gap: 14px; }
.bbi-fg-facts span { flex: 1; }
.bbi-fg-facts small { display: block; font-size: 11px; font-weight: 700; color: var(--bbi-muted); }
.bbi-fg-facts b { display: block; font-size: 13px; font-weight: 800; color: var(--bbi-ink); }

.bbi-fg-counts { display: flex; gap: 10px; margin-top: 10px; }

.bbi-fg-count {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1px solid var(--bbi-line);
  background: var(--bbi-surface-2);
}

.bbi-fg-count b { font-size: 24px; font-weight: 800; line-height: 1; letter-spacing: -0.02em; }
.bbi-fg-count small { font-size: 12px; font-weight: 700; line-height: 1.2; color: var(--bbi-muted); }
.bbi-fg-count--rel b { color: var(--bbi-indigo); }
.bbi-fg-count--all b { color: #0b8aa3; }

.bbi-fg-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  margin-top: 6px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1.5px solid transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--bbi-ink);
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
}

.bbi-fg-counts + .bbi-fg-opt { margin-top: 10px; }
.bbi-fg-opt.is-hover { background: var(--bbi-surface-2); }
.bbi-fg-opt--pick { color: var(--bbi-muted); }

.bbi-fg-node {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  background: #6c7a93;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.bbi-fg-radio {
  position: relative;
  width: 18px;
  height: 18px;
  flex: none;
  border-radius: 50%;
  border: 2px solid var(--bbi-faint);
  transition: border-color 0.25s ease;
}

.bbi-fg-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--bbi-indigo);
  transform: scale(0);
  transition: transform 0.3s var(--bbi-spring);
}

.bbi-fg-opt.is-checked {
  border-color: var(--bbi-indigo);
  background: #f3f5ff;
  box-shadow: inset 4px 0 0 var(--bbi-indigo);
}

.bbi-fg-opt.is-checked .bbi-fg-radio { border-color: var(--bbi-indigo); }
.bbi-fg-opt.is-checked .bbi-fg-radio::after { transform: scale(1); }

.bbi-fg-dialog__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  margin: 14px 18px 0;
}

.bbi-fg-cancel { font-size: 14px; font-weight: 700; color: var(--bbi-muted); }

.bbi-fg-accept {
  height: 42px;
  padding: 0 18px;
  font-size: 14px;
  background: var(--bbi-grad-good);
  box-shadow: 0 12px 22px -10px rgba(26, 174, 111, 0.65);
}

.bbi-fg-accept svg { width: 15px; height: 15px; }

/* ---------- Result toast ---------- */

.bbi-fg-toast {
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px 0 10px;
  border-radius: 14px;
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
  transition: opacity 0.3s ease, transform 0.45s var(--bbi-spring);
}

.bbi-fg-toast.is-on { opacity: 1; transform: none; }

.bbi-fg-toast__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  background: var(--bbi-grad-good);
  color: #fff;
}

.bbi-fg-toast__icon svg { width: 17px; height: 17px; }
.bbi-fg-toast b { display: block; font-size: 14px; font-weight: 800; color: var(--bbi-ink); white-space: nowrap; }
.bbi-fg-toast small { display: block; font-size: 12px; font-weight: 600; color: var(--bbi-muted); white-space: nowrap; }
