/* Account field recommendations + Custom SOQL rollups */

.bbi-fr-rec .bbi-card__head,
.bbi-fr-soql .bbi-card__head,
.bbi-fr-table .bbi-card__head { padding: 15px 18px 11px; }

/* Summary */
.bbi-fr-sum {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 18px 12px;
}

.bbi-fr-sum .bbi-pill b { font-weight: 800; }

/* Field rows */
.bbi-fr-list { display: grid; gap: 6px; padding: 0 12px; }

.bbi-fr-field {
  padding: 8px 10px 9px 12px;
  border-radius: 14px;
  background: var(--bbi-surface-2);
  border: 1px solid transparent;
  transition: background-color 0.4s ease, border-color 0.4s ease;
}

.bbi-fr-field.is-added { background: #f2fbf6; border-color: var(--bbi-good-edge); }

.bbi-fr-field__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 26px;
}

.bbi-fr-field__top b {
  font-size: 13px;
  font-weight: 800;
  color: var(--bbi-ink);
  white-space: nowrap;
}

.bbi-fr-mapped,
.bbi-fr-add {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px 0 7px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.bbi-fr-mapped svg,
.bbi-fr-add svg { width: 12px; height: 12px; }
.bbi-fr-mapped { color: var(--bbi-good); }
.bbi-fr-mapped.is-added { background: var(--bbi-good-bg); }

.bbi-fr-add {
  background: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(94, 114, 228, 0.35);
  color: var(--bbi-indigo);
}

.bbi-fr-field__use {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}

.bbi-fr-sig {
  flex: none;
  width: 98px;
  height: 22px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  white-space: nowrap;
}

.bbi-fr-sig--metric { background: rgba(94, 114, 228, 0.12); color: var(--bbi-indigo); }
.bbi-fr-sig--segment { background: rgba(17, 167, 196, 0.13); color: #0d8aa3; }
.bbi-fr-sig--time { background: #ffe9dc; color: #dc5208; }

.bbi-fr-field .bbi-bar { flex: 1; height: 9px; background: #e6eaf3; }
.bbi-fr-field .bbi-bar__fill { background: linear-gradient(90deg, #2dcecc, #11a7c4); transition: width 0.7s var(--bbi-ease); }

.bbi-fr-pct {
  width: 36px;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
  color: var(--bbi-ink);
  font-variant-numeric: tabular-nums;
}

.bbi-fr-foot {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 17px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--bbi-muted);
  white-space: nowrap;
}

.bbi-fr-foot svg { width: 13px; height: 13px; flex: none; }

/* Custom SOQL */
.bbi-fr-opts { margin-top: 6px; padding: 0 18px; }

.bbi-fr-opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  font-size: 13px;
  font-weight: 600;
  color: var(--bbi-muted);
}

.bbi-fr-opt + .bbi-fr-opt { border-top: 1px solid var(--bbi-line); }

.bbi-fr-select {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 8px;
  border-radius: 8px;
  border: 1px solid #dfe3f1;
  font-size: 13px;
  font-weight: 800;
  color: var(--bbi-ink);
}

.bbi-fr-select svg { width: 14px; height: 14px; color: #0b8bd8; }

.bbi-fr-roll { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.bbi-fr-roll em { font-style: normal; font-weight: 700; color: var(--bbi-muted); }
.bbi-fr-roll svg { width: 13px; height: 13px; color: var(--bbi-faint); }
.bbi-fr-roll b { font-weight: 800; color: var(--bbi-indigo); }

.bbi-fr-code {
  margin: 0 18px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--bbi-navy-deep);
  font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.55;
  color: #dbe2ff;
  white-space: pre;
  transition: box-shadow 0.35s ease;
}

.bbi-fr-code i { font-style: normal; font-weight: 700; color: #ff7ab6; }
.bbi-fr-code u { text-decoration: none; color: #8fe3b8; }
.bbi-fr-code s { text-decoration: none; color: #ffc078; }
.bbi-fr-code.is-focus { box-shadow: 0 0 0 4px rgba(94, 114, 228, 0.22); }

.bbi-fr-run {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.bbi-fr-grain { height: 26px; }

.bbi-fr-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--bbi-muted);
  white-space: nowrap;
}

.bbi-fr-status svg { width: 13px; height: 13px; }
.bbi-fr-status.is-good { color: var(--bbi-good); font-weight: 800; }
.bbi-fr-grain svg { width: 13px; height: 13px; }

.bbi-fr-go {
  margin-left: auto;
  height: 38px;
  padding: 0 14px;
  gap: 7px;
  font-size: 13px;
}

.bbi-fr-go svg { width: 15px; height: 15px; }

.bbi-fr-go.is-busy {
  background-image: linear-gradient(100deg, #5e72e4 0%, #825ee4 40%, #b7a5f5 50%, #825ee4 60%, #5e72e4 100%);
  background-size: 250% 100%;
}

.bbi-fr-go.is-success { background: var(--bbi-grad-good); box-shadow: 0 12px 24px -10px rgba(26, 174, 111, 0.5); }

/* Accounts table */
.bbi-fr-grid {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 128px;
  grid-template-rows: 22px repeat(3, 32px);
  column-gap: 10px;
  row-gap: 5px;
  align-items: center;
  padding: 0 18px;
}

.bbi-fr-grid::after {
  content: '';
  position: absolute;
  top: -6px;
  bottom: -6px;
  right: 12px;
  width: 138px;
  border-radius: 12px;
  background: rgba(94, 114, 228, 0.07);
  box-shadow: inset 0 0 0 1.5px rgba(94, 114, 228, 0.22);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.bbi-fr-table.has-new .bbi-fr-grid::after { opacity: 1; }

.bbi-fr-th {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bbi-muted);
  white-space: nowrap;
}

.bbi-fr-th--new {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  padding-right: 6px;
  letter-spacing: 0.03em;
  color: var(--bbi-indigo);
}

.bbi-fr-th--new svg { width: 12px; height: 12px; }

.bbi-fr-grid .bbi-acct { justify-self: start; height: 29px; font-size: 13px; }

.bbi-fr-td {
  font-size: 13px;
  font-weight: 700;
  color: var(--bbi-muted);
}

.bbi-fr-td--new {
  padding-right: 6px;
  text-align: right;
  font-size: 15px;
  font-weight: 800;
  color: var(--bbi-ink);
  font-variant-numeric: tabular-nums;
}

.bbi-fr-th--new,
.bbi-fr-td--new {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.45s var(--bbi-spring);
}

.bbi-fr-th--new.is-in,
.bbi-fr-td--new.is-in { opacity: 1; transform: none; }
