/* ═══════════════════════════════════════════════════════════════
   team.css — Team tab
   ───────────────────────────────────────────────────────────────
   Selectors that ONLY render in the Team tab.
   Extracted from dashboard.css in Phase 3.5 (2026-05-30).
   Loaded AFTER dashboard.css; shared chrome lives there.
   ═══════════════════════════════════════════════════════════════ */


/* ── #168 — Team tab explainer + permission checklist ────────────────── */
/* One-line orientation + a "Create Role in CRM" CTA. Followed by an
   always-visible "Required permissions" card; the recommended + not-used
   buckets sit behind a collapsible "See more" toggle so the top of the
   page stays compact. */

.dash-team-explainer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.06), rgba(37, 211, 102, 0.02));
  border: 1px solid rgba(37, 211, 102, 0.18);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.dash-team-explainer-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-primary, #f1f4f9);
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

.dash-team-explainer-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(37, 211, 102, 0.12);
  border: 1px solid rgba(37, 211, 102, 0.35);
  border-radius: 8px;
  color: var(--accent-green);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dash-team-explainer-cta:hover {
  background: rgba(37, 211, 102, 0.18);
  border-color: rgba(37, 211, 102, 0.55);
}

/* Always-visible required permissions card. */
.dash-perm-required-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 0.85rem 1rem 0.95rem;
  margin-bottom: 1rem;
}

.dash-perm-required-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}

.dash-perm-required-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary, #f1f4f9);
  letter-spacing: -0.005em;
}

.dash-perm-required-sub {
  font-size: 0.76rem;
  color: var(--text-muted, #a4adc1);
  margin-top: 2px;
  line-height: 1.4;
}

.dash-perm-retry {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 6px;
  color: #f59e0b;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.dash-perm-retry:hover { background: rgba(245, 158, 11, 0.18); }

.dash-perm-more-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.7rem;
  padding: 5px 10px;
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 7px;
  color: var(--text-muted, #a4adc1);
  font-size: 0.76rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.dash-perm-more-toggle:hover {
  color: var(--text-primary, #f1f4f9);
  border-color: rgba(255, 255, 255, 0.25);
}

.dash-perm-extra { margin-top: 0.7rem; }

.dash-perm-required-hint {
  font-size: 0.72rem;
  color: var(--text-muted, #a4adc1);
  font-weight: 500;
  margin-left: 4px;
}

/* Bucket layout — one row per CRM module, leaf items as inline check-pills.
   Replaces the per-perm card list so the whole thing fits in 4-5 rows. */
.dash-perm-bucket-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.dash-perm-bucket {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.6rem;
  padding: 0.35rem 0;
}

.dash-perm-bucket-parent {
  font-size: 0.78rem;
  color: var(--text-muted, #a4adc1);
  font-weight: 500;
  flex-shrink: 0;
  min-width: 130px;
}

.dash-perm-bucket-leaves {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  flex: 1;
  min-width: 0;
}

/* Inline check-pills */
.dash-perm-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  line-height: 1.5;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #f1f4f9);
  white-space: nowrap;
  cursor: default;
}

.dash-perm-pill-check {
  font-size: 0.78rem;
  line-height: 1;
}

.dash-perm-pill-tick {
  background: rgba(37, 211, 102, 0.10);
  border-color: rgba(37, 211, 102, 0.32);
}
.dash-perm-pill-tick .dash-perm-pill-check { color: var(--accent-green); }

.dash-perm-pill-tick-soft {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.30);
}
.dash-perm-pill-tick-soft .dash-perm-pill-check { color: #f59e0b; }

.dash-perm-pill-mute {
  background: rgba(255, 255, 255, 0.025);
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted, #a4adc1);
  font-size: 0.72rem;
}

.dash-perm-not-used {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
}

/* Toolbar row + roles chip row that sit above the team table. */
.dash-team-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.dash-team-roles-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 0.75rem;
  padding: 0.6rem 0.85rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 0.85rem;
}
.dash-team-roles-label {
  font-size: 0.78rem;
  color: var(--text-muted, #a4adc1);
  font-weight: 500;
}
.dash-team-roles-chips {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Phase 5f: Team table polish — WA phone cell + consolidated actions cluster.
   All colors come from existing tokens. No new tokens introduced. */
.dash-team-wa-phone {
  font-size: 0.8rem;
  color: var(--accent-green);
  font-variant-numeric: tabular-nums;
}
.dash-team-wa-phone--empty {
  font-size: 0.75rem;
  color: var(--text-muted, #5c6577);
}

.dash-team-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.dash-team-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  transition: background-color 120ms ease, color 120ms ease;
}
.dash-team-action i { width: 14px; height: 14px; }
.dash-team-action:hover {
  background: rgba(255, 255, 255, 0.05);
  text-decoration: none;
}

.dash-team-action--info { color: var(--accent-blue, #60a5fa); }
.dash-team-action--info:hover { background: var(--color-info-bg, rgba(96, 165, 250, 0.1)); }

.dash-team-action--edit { color: var(--accent-green); }
.dash-team-action--edit:hover { background: var(--color-success-bg, rgba(37, 211, 102, 0.1)); }

.dash-team-action--delete { color: var(--color-error, #ef4444); }
.dash-team-action--delete:hover { background: var(--color-error-bg, rgba(239, 68, 68, 0.1)); }

/* Permission checklist drawer (collapsible). */
.dash-perm-checklist {
  margin-bottom: 1.25rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

.dash-perm-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding-bottom: 0.85rem;
  margin-bottom: 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.82rem;
  color: var(--text-muted, #a4adc1);
  line-height: 1.5;
}
.dash-perm-intro p { margin: 0 0 0.5rem; }
.dash-perm-intro strong { color: var(--text-primary, #f1f4f9); font-weight: 600; }

.dash-perm-group { margin-bottom: 1rem; }
.dash-perm-group:last-child { margin-bottom: 0; }

.dash-perm-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}
.dash-perm-tier-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dash-perm-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-primary, #f1f4f9);
}
.dash-perm-group-count {
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #a4adc1);
  padding: 1px 7px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.dash-perm-group-blurb {
  flex: 1 0 100%;
  font-size: 0.78rem;
  color: var(--text-muted, #a4adc1);
  margin-top: 2px;
}

.dash-perm-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dash-perm-item {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 10px;
}

.dash-perm-group-required    .dash-perm-item { border-left: 3px solid rgba(239, 68, 68, 0.55); }
.dash-perm-group-recommended .dash-perm-item { border-left: 3px solid rgba(245, 158, 11, 0.55); }
.dash-perm-group-not_used    .dash-perm-item { border-left: 3px solid rgba(108, 118, 137, 0.45); opacity: 0.85; }

.dash-perm-box {
  flex-shrink: 0;
  font-size: 0.95rem;
  line-height: 1;
  margin-top: 2px;
  color: var(--text-primary, #f1f4f9);
}
.dash-perm-group-not_used .dash-perm-box { color: var(--text-muted, #6c7689); }

.dash-perm-item-body { flex: 1; min-width: 0; }
.dash-perm-item-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #f1f4f9);
}
.dash-perm-item-path {
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--accent-green);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.dash-perm-item-breaks {
  margin-top: 4px;
  font-size: 0.76rem;
  color: var(--text-muted, #a4adc1);
  line-height: 1.45;
}
