/* Lock rules: lock matching accounts to a specific territory */

.bbi-lr-static,
.bbi-lr-static * { transition: none !important; }

.bbi-lr-chevdn { width: 13px; height: 13px; flex: none; margin-left: auto; color: #a3acc7; }

/* ---------- Rule builder ---------- */

.bbi-lr-rulecard .bbi-card__head { padding: 14px 16px 10px 18px; }
.bbi-lr-rulecard .bbi-tile { width: 36px; height: 36px; }

.bbi-lr-ttl { display: flex; flex-direction: column; line-height: 1.2; }

.bbi-lr-ttl small {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #d97706;
}

.bbi-lr-ttl b { font-size: 16px; font-weight: 800; color: var(--bbi-ink); }
.bbi-lr-state { margin-left: auto; }

.bbi-lr-body { padding: 0 16px 16px; }

.bbi-lr-eyebrow {
  display: flex;
  align-items: center;
  height: 16px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bbi-muted);
}

.bbi-lr-eyebrow span {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--bbi-indigo);
}

.bbi-lr-conds { display: grid; gap: 6px; margin-bottom: 14px; }

.bbi-lr-cond {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 34px;
}

.bbi-lr-join {
  display: grid;
  place-items: center;
  width: 46px;
  height: 24px;
  flex: none;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  color: var(--bbi-muted);
}

.bbi-lr-join.is-and { background: rgba(94, 114, 228, 0.12); color: var(--bbi-indigo); letter-spacing: 0.04em; }

.bbi-lr-fld {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--bbi-line);
  background: #fff;
  font-size: 13px;
  font-weight: 700;
  color: var(--bbi-ink);
  white-space: nowrap;
}

.bbi-lr-fld--val { flex-grow: 1.15; background: var(--bbi-surface-2); }
.bbi-lr-op { flex: none; font-size: 13px; font-weight: 800; color: var(--bbi-indigo); }

.bbi-lr-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 12px;
  border-radius: 11px;
  border: 1.5px dashed #c9d2ec;
  background: #fff;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.bbi-lr-picker .bbi-lr-chevdn { width: 15px; height: 15px; }
.bbi-lr-picker__empty { font-size: 13px; font-weight: 700; color: #a3acc7; }
.bbi-lr-picker__val { display: none; align-items: center; gap: 10px; min-width: 0; }
.bbi-lr-picker__val .bbi-avatar { width: 28px; height: 28px; box-shadow: 0 0 0 2px #fff, var(--bbi-shadow-sm); }
.bbi-lr-picker__val b { display: block; font-size: 14px; font-weight: 800; line-height: 1.2; color: var(--bbi-ink); }
.bbi-lr-picker__val small { display: block; font-size: 11px; font-weight: 700; color: var(--bbi-muted); }

.bbi-lr-picker.is-open {
  border-style: solid;
  border-color: rgba(94, 114, 228, 0.6);
  box-shadow: 0 0 0 4px rgba(94, 114, 228, 0.12);
}

.bbi-lr-picker.is-set { border-style: solid; border-color: #ffd28a; background: #fffaf0; }
.bbi-lr-picker.is-set .bbi-lr-picker__empty { display: none; }
.bbi-lr-picker.is-set .bbi-lr-picker__val { display: flex; }

.bbi-lr-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}

.bbi-lr-test {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 36px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1.5px solid rgba(94, 114, 228, 0.4);
  font-size: 13px;
  font-weight: 800;
  color: var(--bbi-indigo);
  white-space: nowrap;
  transition: transform 0.2s var(--bbi-ease), background-color 0.2s ease;
}

.bbi-lr-test svg { width: 15px; height: 15px; }
.bbi-lr-test.is-pressed { transform: scale(0.94); background: rgba(94, 114, 228, 0.1); }

.bbi-lr-result {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: #a3acc7;
  white-space: nowrap;
}

.bbi-lr-result.is-on { color: var(--bbi-ink); }
.bbi-lr-result b { font-size: 16px; font-weight: 800; color: #d97706; font-variant-numeric: tabular-nums; }

.bbi-lr-save {
  flex: none;
  justify-content: center;
  width: 68px;
  height: 36px;
  padding: 0;
  font-size: 13px;
}

.bbi-lr-save.is-success {
  background: var(--bbi-grad-good);
  box-shadow: 0 10px 20px -8px rgba(26, 174, 111, 0.45);
}

/* Lock destination menu */
.bbi-lr-drop { z-index: 9; padding: 6px; }

.bbi-lr-drop__opt {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 10px;
  border-radius: 9px;
  transition: background-color 0.2s ease;
}

.bbi-lr-drop__opt .bbi-avatar { width: 26px; height: 26px; box-shadow: none; }
.bbi-lr-drop__opt b { display: block; font-size: 13px; font-weight: 800; line-height: 1.2; color: var(--bbi-ink); }
.bbi-lr-drop__opt small { display: block; font-size: 11px; font-weight: 700; color: var(--bbi-muted); }
.bbi-lr-drop__opt i { width: 10px; height: 10px; margin-left: auto; border-radius: 50%; flex: none; }
.bbi-lr-drop__opt.is-hover { background: rgba(94, 114, 228, 0.1); }

/* ---------- Account list ---------- */

.bbi-lr-accts .bbi-card__head { padding: 14px 16px 10px 18px; }
.bbi-lr-acount { margin-left: auto; }

.bbi-lr-alist { display: grid; gap: 5px; padding: 0 12px 10px; }

.bbi-lr-arow {
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: var(--bbi-surface-2);
  transition: background-color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.bbi-lr-arow__top { display: flex; align-items: center; gap: 10px; height: 20px; }

.bbi-lr-arow__top b {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
  color: var(--bbi-ink);
  white-space: nowrap;
}

.bbi-lr-sq { width: 20px; height: 20px; flex: none; border-radius: 6px; }

.bbi-lr-terr {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--bbi-line);
  font-size: 12px;
  font-weight: 700;
  color: var(--bbi-ink);
  white-space: nowrap;
}

.bbi-lr-terr i { width: 8px; height: 8px; border-radius: 50%; flex: none; }

.bbi-lr-arow__sub { display: flex; align-items: center; height: 20px; margin-top: 2px; padding-left: 30px; }
.bbi-lr-meta { font-size: 12px; font-weight: 600; color: var(--bbi-muted); }

.bbi-lr-lockchip {
  display: none;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 8px;
  border-radius: 6px;
  background: #fff1db;
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
  white-space: nowrap;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.bbi-lr-lockchip svg { width: 11px; height: 11px; }

.bbi-lr-arow.is-match { border-color: #ffd28a; border-style: dashed; }

.bbi-lr-arow.is-locked { background: #fffaf0; border-color: #ffd28a; }
.bbi-lr-arow.is-locked .bbi-lr-meta { display: none; }

.bbi-lr-arow.is-locked .bbi-lr-lockchip {
  display: inline-flex;
  animation: bbi-pop-in 0.5s var(--bbi-spring) both;
}

.bbi-lr-static .bbi-lr-arow.is-locked .bbi-lr-lockchip { animation: none; }

.bbi-lr-arow.is-held { animation: bbi-lr-hold 0.9s ease-in-out 2; }
.bbi-lr-arow.is-held .bbi-lr-lockchip { background: #d97706; color: #fff; }

@keyframes bbi-lr-hold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); }
  50% { box-shadow: 0 0 0 5px rgba(217, 119, 6, 0.22); }
}

.bbi-lr-arow.is-moved { background: #f3fcf8; border-color: var(--bbi-good-edge); }
.bbi-lr-arow.is-focus { box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.28); }

/* ---------- BoogieBoard ---------- */

.bbi-lr-board .bbi-card__head { padding: 12px 16px 4px 18px; }
.bbi-lr-status { margin-left: 4px; }

.bbi-lr-balance {
  margin-left: auto;
  height: 34px;
  padding: 0 16px;
  gap: 8px;
  font-size: 13px;
}

.bbi-lr-balance svg { width: 15px; height: 15px; }

.bbi-lr-balance.is-success {
  background: var(--bbi-grad-good);
  box-shadow: 0 10px 20px -8px rgba(26, 174, 111, 0.45);
}

.bbi-lr-pgrid {
  display: grid;
  grid-template-columns: 250px 1fr 1fr;
  gap: 5px 10px;
  padding: 0 18px 14px;
}

.bbi-lr-pgrid .bbi-pivot__head { height: 20px; }
.bbi-lr-pgrid .bbi-territory { height: 36px; gap: 10px; }
.bbi-lr-pgrid .bbi-territory .bbi-avatar { width: 28px; height: 28px; box-shadow: 0 0 0 2px #fff, var(--bbi-shadow-sm); }
.bbi-lr-pgrid .bbi-territory__name { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.bbi-lr-pgrid .bbi-territory__owner { font-size: 11px; }
.bbi-lr-pgrid .bbi-cell { height: 36px; padding: 0 14px; font-size: 15px; }

.bbi-lr-dev {
  margin-left: auto;
  font-size: 12px;
  font-weight: 800;
  opacity: 0.8;
}

.bbi-lr-lockbadge {
  display: none;
  align-items: center;
  gap: 4px;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  background: #fff1db;
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
}

.bbi-lr-lockbadge svg { width: 11px; height: 11px; }

.bbi-lr-lockbadge.is-on {
  display: inline-flex;
  animation: bbi-pop-in 0.5s var(--bbi-spring) both;
}

.bbi-lr-static .bbi-lr-lockbadge.is-on { animation: none; }

/* ---------- Why is this locked? ---------- */

.bbi-lr-why {
  z-index: 10;
  padding: 10px 14px;
  border-color: #ffd28a;
  box-shadow: 0 22px 40px -16px rgba(50, 50, 93, 0.45), 0 6px 12px -8px rgba(0, 0, 0, 0.12);
}

.bbi-lr-why::before {
  content: '';
  position: absolute;
  top: -7px;
  left: var(--bbi-lr-tip, 40px);
  width: 12px;
  height: 12px;
  background: #fff;
  border-left: 1px solid #ffd28a;
  border-top: 1px solid #ffd28a;
  transform: rotate(45deg);
}

.bbi-lr-why__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 800;
  color: #b45309;
}

.bbi-lr-why__title svg { width: 15px; height: 15px; }

.bbi-lr-why p {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--bbi-ink);
}

.bbi-lr-why p b { font-weight: 800; }

.bbi-lr-why__arrow { display: inline-block; vertical-align: -2px; color: #d97706; }
.bbi-lr-why__arrow svg { display: block; width: 14px; height: 14px; }
