/* Roster import: paste territory owners, review the naming preview, fill the seats */

/* ---------- Roles grid ---------- */

.bbi-rim-cols,
.bbi-rim-row {
  display: grid;
  grid-template-columns: 108px 100px 92px 92px;
  column-gap: 6px;
  align-items: center;
  padding: 0 12px;
}

.bbi-rim-cols {
  height: 54px;
  border-bottom: 1px solid var(--bbi-line);
}

.bbi-rim-cols__terr {
  padding-left: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bbi-muted);
}

.bbi-rim-cols__role {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.bbi-rim-cols__role small {
  font-size: 11px;
  font-weight: 700;
  color: var(--bbi-muted);
  white-space: nowrap;
}

.bbi-rim-type {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.bbi-rim-type--owner { background: rgba(94, 114, 228, 0.12); color: var(--bbi-indigo); }
.bbi-rim-type--support { background: #f1ebff; color: #6b46d6; }
.bbi-rim-type--manager { background: #e9edf5; color: var(--bbi-navy); }

.bbi-rim-rows { padding-top: 6px; }

.bbi-rim-row {
  height: 84px;
  border-bottom: 1px solid var(--bbi-line);
  overflow: hidden;
  transition: height 0.5s var(--bbi-ease), opacity 0.4s ease, background-color 0.4s ease;
}

.bbi-rim-row:last-child { border-bottom: 0; }
.bbi-rim-row.is-collapsed { height: 0; opacity: 0; }
.bbi-rim-row.is-new { background: linear-gradient(90deg, rgba(251, 140, 0, 0.07), transparent 60%); }

.bbi-rim-terr { padding-left: 6px; min-width: 0; }
.bbi-rim-terr b { display: block; font-size: 14px; font-weight: 800; line-height: 1.25; color: var(--bbi-ink); }

.bbi-rim-terr small {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--bbi-muted);
  white-space: nowrap;
}

.bbi-rim-terr small svg { width: 10px; height: 10px; }
.bbi-rim-row.is-new .bbi-rim-terr small { color: #d97706; font-weight: 800; }

.bbi-rim-seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  height: 70px;
  border-radius: 12px;
  border: 1.5px dashed #d3d9ee;
  background: #fafbff;
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.bbi-rim-seat.is-filled {
  border-style: solid;
  border-color: var(--bbi-line);
  background: #fff;
  box-shadow: var(--bbi-shadow-sm);
}

.bbi-rim-seat.is-new {
  border-color: rgba(94, 114, 228, 0.45);
  background: #f7f8ff;
  box-shadow: 0 0 0 3px rgba(94, 114, 228, 0.08);
}

.bbi-rim-seat .bbi-avatar { width: 28px; height: 28px; margin-bottom: 1px; box-shadow: 0 0 0 2px #fff; }

.bbi-rim-seat b {
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  color: var(--bbi-ink);
  white-space: nowrap;
}

.bbi-rim-seat small {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--bbi-muted);
  white-space: nowrap;
}

.bbi-rim-seat small svg { width: 11px; height: 11px; }
.bbi-rim-seat.is-new small { color: var(--bbi-indigo); }

.bbi-rim-seat__plus {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #edf0f9;
  color: #a3aecb;
}

.bbi-rim-seat__plus svg { width: 15px; height: 15px; }

.bbi-rim-foot {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.bbi-rim-foot .bbi-tag { height: 30px; padding: 0 11px; font-size: 12px; }
.bbi-rim-foot .bbi-tag svg { width: 14px; height: 14px; }
.bbi-rim-unassigned b { font-variant-numeric: tabular-nums; }
.bbi-rim-mismatch { margin-left: auto; }

/* ---------- Import from clipboard ---------- */

.bbi-rim-paste .bbi-card__head { white-space: nowrap; }

.bbi-rim-seg {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 3px;
  height: 34px;
  margin: 0 14px;
  padding: 3px;
  border-radius: 10px;
  background: var(--bbi-surface-2);
}

.bbi-rim-seg span {
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--bbi-muted);
  white-space: nowrap;
}

.bbi-rim-seg span.is-on { background: #fff; color: var(--bbi-indigo); box-shadow: var(--bbi-shadow-sm), 0 0 0 1.5px rgba(94, 114, 228, 0.3); }

.bbi-rim-clip {
  position: relative;
  height: 100px;
  margin: 10px 14px 0;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--bbi-line);
  background: var(--bbi-surface-2);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  transition: border-color 0.3s ease, background-color 0.3s ease, transform 0.2s ease;
}

.bbi-rim-clip.is-pressed { transform: scale(0.99); }
.bbi-rim-clip.is-filled { background: #fff; border-color: rgba(94, 114, 228, 0.3); }

.bbi-rim-clip__hint {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--bbi-font);
  font-size: 12px;
  font-weight: 700;
  color: var(--bbi-faint);
  transition: opacity 0.2s ease;
}

.bbi-rim-key {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  place-items: center;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid #d7dcf0;
  border-bottom-width: 2px;
  background: #fff;
  font-family: var(--bbi-font);
  font-size: 11px;
  font-weight: 800;
  color: var(--bbi-muted);
  transition: opacity 0.3s ease, transform 0.2s ease, color 0.2s ease;
}

.bbi-rim-key.is-on { transform: translateY(1px); color: var(--bbi-indigo); border-color: rgba(94, 114, 228, 0.5); }

.bbi-rim-line {
  display: block;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
  color: var(--bbi-ink);
  white-space: nowrap;
  opacity: 0;
}

.bbi-rim-clip.is-filled .bbi-rim-line { opacity: 1; }
.bbi-rim-clip.is-filled .bbi-rim-clip__hint,
.bbi-rim-clip.is-filled .bbi-rim-key { opacity: 0; }

.bbi-rim-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  height: 32px;
  margin: 10px 14px 0 auto;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid rgba(94, 114, 228, 0.35);
  background: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--bbi-indigo);
  transition: transform 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

.bbi-rim-preview svg { width: 14px; height: 14px; }
.bbi-rim-preview.is-pressed { transform: scale(0.95); }
.bbi-rim-preview.is-busy { background: rgba(94, 114, 228, 0.1); }
.bbi-rim-preview.is-done { background: rgba(94, 114, 228, 0.08); border-color: transparent; }

.bbi-rim-review {
  position: relative;
  margin: 8px 14px 0;
}

.bbi-rim-review__head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  height: 22px;
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--bbi-muted);
}

.bbi-rim-review__head small {
  margin-left: auto;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
}

.bbi-rim-ghost {
  position: absolute;
  top: 26px;
  left: 0;
  right: 0;
  height: 168px;
  display: grid;
  place-items: center;
  padding: 0 30px;
  border: 2px dashed #e1e5f3;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  color: var(--bbi-faint);
  transition: opacity 0.3s ease;
}

.bbi-rim-review.is-on .bbi-rim-ghost { opacity: 0; }

.bbi-rim-match {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 38px;
  padding: 0 8px;
  border-radius: 10px;
  opacity: 0;
}

.bbi-rim-match + .bbi-rim-match { margin-top: 5px; }
.bbi-rim-review.is-on .bbi-rim-match { opacity: 1; }

.bbi-rim-match__icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: var(--bbi-good-bg);
  color: var(--bbi-good);
}

.bbi-rim-match__icon svg { width: 12px; height: 12px; }
.bbi-rim-match__text { min-width: 0; }
.bbi-rim-match__text b { display: block; font-size: 13px; font-weight: 800; line-height: 1.2; color: var(--bbi-ink); white-space: nowrap; }
.bbi-rim-match__text small { display: block; font-size: 11px; font-weight: 700; color: var(--bbi-good); white-space: nowrap; }
.bbi-rim-match .bbi-avatar { width: 26px; height: 26px; margin-left: auto; box-shadow: 0 0 0 2px #fff; }

.bbi-rim-match.is-new {
  height: 44px;
  border: 1px solid #ffd9a0;
  background: #fff8ec;
}

.bbi-rim-match.is-new .bbi-rim-match__icon { background: #ffe8c2; color: #d97706; }
.bbi-rim-match.is-new small { color: #d97706; }

.bbi-rim-apply {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  font-size: 14px;
}

.bbi-rim-apply svg { width: 16px; height: 16px; flex: none; }

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

.bbi-rim-flyer {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 15;
  width: 30px;
  height: 30px;
  box-shadow: 0 0 0 2px #fff, 0 14px 24px -8px rgba(50, 50, 93, 0.5);
  pointer-events: none;
}
