/* =========================================================
   FormYar — team & members demo
   ========================================================= */
.team-page {
  --team-radius: 16px;
}
#org,
#members,
#surveyors,
#form-access,
#invites,
#groups,
#roles {
  scroll-margin-top: 82px;
}
.team-page .page-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--brand);
  margin-bottom: 6px;
}
.team-page-head {
  align-items: flex-start;
}
.team-page .panel {
  overflow: hidden;
}
.team-page .panel-head {
  padding: 16px 18px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.team-page .panel-head h3 {
  font-size: 14px;
  margin: 0;
}
.team-page .panel-head p {
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.8;
  color: var(--muted-2);
}
.head-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  margin-inline-start: 5px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 9.5px;
  vertical-align: middle;
}
.panel-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 9.5px;
  font-weight: 800;
  border: 1px solid color-mix(in srgb, var(--brand) 16%, transparent);
}
.panel-chip .icon {
  width: 13px;
  height: 13px;
}

/* ================= hero ================= */
.team-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px;
  margin-bottom: 18px;
  background:
    radial-gradient(circle at 8% 15%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 34%),
    radial-gradient(circle at 92% 90%, color-mix(in srgb, var(--mint) 10%, transparent), transparent 30%),
    var(--card);
}
.team-hero-main {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}
.workspace-logo {
  width: 64px;
  height: 64px;
  border-radius: 19px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #0f766e));
  box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--brand) 70%, transparent);
}
.workspace-logo .icon {
  width: 29px;
  height: 29px;
}
.team-hero-copy {
  min-width: 0;
}
.team-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 800;
  color: var(--brand);
  margin-bottom: 4px;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  background: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 14%, transparent);
}
.team-hero h2 {
  font-size: 20px;
  letter-spacing: -0.02em;
  margin: 0;
}
.team-hero p {
  font-size: 10.5px;
  color: var(--muted-2);
  margin-top: 5px;
  line-height: 1.8;
}
.hero-avatars {
  display: flex;
  align-items: center;
  margin-top: 9px;
  padding-inline-start: 5px;
}
.hero-avatars .tm-avatar {
  margin-inline-start: -5px;
  border: 2px solid var(--card);
}
.team-hero-side {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: none;
}
.hero-plan {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: color-mix(in srgb, var(--card) 80%, transparent);
}
.plan-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--amber-soft);
  color: var(--amber);
}
.plan-icon .icon {
  width: 17px;
  height: 17px;
}
.hero-plan small,
.hero-renew small {
  display: block;
  font-size: 9px;
  color: var(--muted-2);
}
.hero-plan b,
.hero-renew b {
  display: block;
  font-size: 11.5px;
  margin-top: 2px;
}
.hero-renew {
  padding-inline-start: 17px;
  border-inline-start: 1px solid var(--line);
}

/* ================= kpis ================= */
.team-kpis {
  margin-bottom: 18px;
}
.team-kpis .kpi-value {
  font-size: 26px;
}

/* ================= layout ================= */
.team-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 328px;
  gap: 18px;
  align-items: start;
}
.team-main,
.team-side {
  display: grid;
  gap: 18px;
  min-width: 0;
}

/* ================= avatars / badges ================= */
.tm-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  flex: none;
  object-fit: cover;
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  color: #064e3b;
  background: #d1fae5;
}
.tm-avatar.sm {
  width: 29px;
  height: 29px;
  font-size: 9px;
}
.tm-avatar.lg {
  width: 60px;
  height: 60px;
  font-size: 17px;
}
.tm-avatar.more {
  background: var(--surface-2, var(--line));
  color: var(--muted);
  font-size: 9px;
}
.tm-avatar.tone-0 { background: #dbeafe; color: #1d4ed8; }
.tm-avatar.tone-1 { background: #fef3c7; color: #b45309; }
.tm-avatar.tone-2 { background: #ede9fe; color: #6d28d9; }
.tm-avatar.tone-3 { background: #fee2e2; color: #b91c1c; }
.tm-avatar.tone-4 { background: #ccfbf1; color: #0f766e; }
.tm-avatar.tone-5 { background: #fce7f3; color: #be185d; }

.owner-mark {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--amber-soft);
  color: var(--amber);
  vertical-align: -3px;
  margin-inline-start: 2px;
}
.owner-mark .icon {
  width: 10px;
  height: 10px;
}
.status-pill {
  display: inline-flex;
  width: fit-content;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 800;
  white-space: nowrap;
}
.status-pill.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.status-pill.suspended {
  background: #fef2f2;
  color: #b91c1c;
}
[data-theme="dark"] .status-pill.suspended {
  background: #3a191b;
  color: #fca5a5;
}
.role-pill {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 800;
  white-space: nowrap;
}
.role-pill.owner { background: var(--amber-soft); color: var(--amber); }
.role-pill.admin { background: #dbeafe; color: #1d4ed8; }
.role-pill.editor { background: var(--brand-soft); color: var(--brand); }
.role-pill.analyst { background: #ede9fe; color: #6d28d9; }
.role-pill.viewer { background: var(--surface-2, var(--line)); color: var(--muted); }
[data-theme="dark"] .role-pill.admin { background: #172a45; color: #93c5fd; }
[data-theme="dark"] .role-pill.analyst { background: #281d43; color: #c4b5fd; }
.group-chip {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 700;
  white-space: nowrap;
}
.group-chip.emerald { background: var(--brand-soft); color: var(--brand); }
.group-chip.blue { background: #dbeafe; color: #1d4ed8; }
.group-chip.amber { background: var(--amber-soft); color: var(--amber); }
.group-chip.violet { background: #ede9fe; color: #6d28d9; }
.group-chip.coral { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .group-chip.blue { background: #172a45; color: #93c5fd; }
[data-theme="dark"] .group-chip.violet { background: #281d43; color: #c4b5fd; }
[data-theme="dark"] .group-chip.coral { background: #3a191b; color: #fca5a5; }
.security-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: fit-content;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 700;
  white-space: nowrap;
}
.security-chip .icon {
  width: 10px;
  height: 10px;
}
.security-chip.on {
  background: var(--brand-soft);
  color: var(--brand);
}
.security-chip.off {
  background: var(--surface-2, var(--line));
  color: var(--muted-2);
}
.muted-xs {
  font-size: 9px;
  color: var(--muted-2);
}

/* ================= members ================= */
.team-members-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2, var(--line)) 36%, transparent);
}
.team-status-tabs {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.team-status-tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 9.5px;
  font-weight: 700;
  border-radius: 7px;
  padding: 6px 9px;
  cursor: pointer;
  white-space: nowrap;
}
.team-status-tabs button b {
  font-size: 8px;
  font-weight: 800;
  color: var(--muted-2);
  margin-inline-start: 2px;
}
.team-status-tabs button.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.team-status-tabs button.active b {
  color: var(--brand);
}
.team-filter-row {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.team-search {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted-2);
  width: 210px;
  max-width: 100%;
}
.team-search .icon {
  width: 13px;
  height: 13px;
  flex: none;
}
.team-search input {
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 9.5px;
  min-width: 0;
  width: 100%;
}
#teamRoleFilter {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 9.5px;
  padding: 0 8px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
.filter-chip button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted-2);
  cursor: pointer;
}
.filter-chip button:hover {
  background: #fef2f2;
  color: #dc2626;
}
.filter-chip .icon {
  width: 11px;
  height: 11px;
}

.member-list-head,
.member-row {
  display: grid;
  grid-template-columns: minmax(205px, 1.7fr) 124px minmax(100px, 1fr) 132px 92px;
  gap: 10px;
  align-items: center;
  padding: 11px 16px;
}
.member-list-head {
  font-size: 8.5px;
  font-weight: 800;
  color: var(--muted-2);
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2, var(--line)) 24%, transparent);
}
.member-row {
  border-bottom: 1px solid var(--line);
  transition: background 0.18s var(--ease);
}
.member-row:last-child {
  border-bottom: 0;
}
.member-row:hover {
  background: color-mix(in srgb, var(--brand-soft) 38%, transparent);
}
.member-row.is-suspended {
  opacity: 0.72;
}
.member-identity {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}
.mi-copy {
  min-width: 0;
}
.mi-copy b {
  display: block;
  font-size: 10.5px;
  line-height: 1.5;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mi-copy small {
  display: block;
  font-size: 8.5px;
  color: var(--muted-2);
  direction: ltr;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-title {
  display: block;
  font-size: 8.5px;
  color: var(--muted-2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.member-role-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.role-select {
  height: 27px;
  max-width: 112px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 9px;
  font-weight: 700;
  padding: 0 6px;
}
.role-select:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.member-groups {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-width: 0;
}
.member-security {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.member-security small {
  font-size: 8px;
  color: var(--muted-2);
}
.member-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}
.member-actions .btn-icon,
.invite-actions .btn-icon {
  color: var(--muted-2);
}
.member-actions .btn-icon:hover,
.invite-actions .btn-icon:hover {
  color: var(--brand);
  background: var(--brand-soft);
}
.member-actions .danger-icon:hover,
.invite-actions .danger-icon:hover {
  color: #dc2626;
  background: #fef2f2;
}
.member-actions [disabled] {
  opacity: 0.3;
}
.team-list-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  font-size: 8.5px;
  color: var(--muted-2);
}
.team-foot-note {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.team-foot-note .icon {
  width: 12px;
  height: 12px;
}
.team-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 34px 20px;
  text-align: center;
}
.team-empty.compact {
  padding: 24px 16px;
}
.team-empty-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.team-empty-icon .icon {
  width: 21px;
  height: 21px;
}
.team-empty b {
  font-size: 12px;
}
.team-empty p {
  font-size: 9.5px;
  color: var(--muted-2);
  line-height: 1.8;
  max-width: 280px;
}
.team-empty .btn {
  margin-top: 4px;
}

/* ================= invites ================= */
.invite-list {
  display: grid;
}
.invite-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.invite-row:last-child {
  border-bottom: 0;
}
.invite-icon {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--amber-soft);
  color: var(--amber);
}
.invite-icon .icon {
  width: 16px;
  height: 16px;
}
.invite-copy {
  flex: 1;
  min-width: 0;
}
.invite-copy > b {
  display: block;
  direction: ltr;
  text-align: right;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.invite-copy > small {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 3px;
}
.invite-code {
  display: inline-block;
  margin-top: 4px;
  font-size: 8.5px;
  color: var(--muted-2);
}
.invite-code code {
  font-size: 8.5px;
  padding: 1px 4px;
  border-radius: 4px;
  background: var(--surface-2, var(--line));
  color: var(--text);
  direction: ltr;
  display: inline-block;
}
.invite-expiry {
  flex: none;
  text-align: center;
  padding-inline: 8px;
}
.invite-expiry b {
  display: block;
  font-size: 10px;
  color: var(--brand);
}
.invite-expiry small {
  display: block;
  font-size: 8px;
  color: var(--muted-2);
  margin-top: 2px;
}
.invite-expiry.expired b {
  color: #dc2626;
}
.invite-actions {
  display: flex;
  gap: 2px;
  flex: none;
}

/* ================= groups ================= */
.group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 13px 16px 16px;
}
.group-card {
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: right;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
  transition: 0.18s var(--ease);
  min-width: 0;
}
.group-card:hover,
.group-card.active {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  background: var(--brand-soft);
  transform: translateY(-1px);
}
.group-icon {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 9px;
  display: grid;
  place-items: center;
}
.group-icon .icon {
  width: 16px;
  height: 16px;
}
.group-icon.emerald { background: var(--brand-soft); color: var(--brand); }
.group-icon.blue { background: #dbeafe; color: #1d4ed8; }
.group-icon.amber { background: var(--amber-soft); color: var(--amber); }
.group-icon.violet { background: #ede9fe; color: #6d28d9; }
.group-icon.coral { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .group-icon.blue { background: #172a45; color: #93c5fd; }
[data-theme="dark"] .group-icon.violet { background: #281d43; color: #c4b5fd; }
[data-theme="dark"] .group-icon.coral { background: #3a191b; color: #fca5a5; }
.group-copy {
  flex: 1;
  min-width: 0;
}
.group-copy b {
  display: block;
  font-size: 10px;
  margin-bottom: 2px;
}
.group-copy small {
  display: block;
  font-size: 8.5px;
  color: var(--muted-2);
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.group-count {
  flex: none;
  font-size: 8px;
  font-weight: 800;
  color: var(--muted-2);
  background: var(--surface-2, var(--line));
  padding: 3px 6px;
  border-radius: 999px;
}

/* ================= role matrix ================= */
.role-table-wrap {
  overflow-x: auto;
  padding: 0 16px;
}
.role-matrix {
  width: 100%;
  min-width: 590px;
  border-collapse: collapse;
  font-size: 9.5px;
}
.role-matrix th,
.role-matrix td {
  padding: 9px 7px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}
.role-matrix th {
  font-size: 8px;
  color: var(--muted-2);
  font-weight: 800;
}
.role-matrix th.center,
.role-matrix td.center {
  text-align: center;
}
.role-matrix tbody tr:last-child td {
  border-bottom: 0;
}
.perm-yes,
.perm-no {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 9px;
}
.perm-yes {
  background: var(--brand-soft);
  color: var(--brand);
}
.perm-yes .icon {
  width: 11px;
  height: 11px;
}
.perm-no {
  color: var(--muted-2);
  background: var(--surface-2, var(--line));
}

/* ================= side panels ================= */
.team-side-card {
  padding: 0;
}
.seat-status {
  flex: none;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 8px;
  font-weight: 800;
  white-space: nowrap;
}
.seat-status.ok { background: var(--brand-soft); color: var(--brand); }
.seat-status.warn { background: var(--amber-soft); color: var(--amber); }
.seat-status.full { background: #fef2f2; color: #b91c1c; }
.seat-body {
  padding: 15px 17px 12px;
}
.seat-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted-2);
}
.seat-line b {
  font-size: 22px;
  color: var(--text);
  letter-spacing: -0.03em;
}
.seat-line b small {
  font-size: 9px;
  font-weight: 500;
  color: var(--muted-2);
}
.seat-line > span {
  font-size: 9px;
  font-weight: 800;
  color: var(--brand);
}
.seat-bar {
  margin-top: 9px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.seat-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 55%, #14b8a6));
  transition: width 0.4s var(--ease);
}
.seat-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 7px;
  font-size: 8px;
  color: var(--muted-2);
}
.seat-renew {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 17px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 9px;
  color: var(--muted-2);
}
.seat-renew b {
  font-size: 9.5px;
  color: var(--text);
}
.team-side-card > .btn-block {
  width: calc(100% - 34px);
  margin: 2px 17px 10px;
}
.team-side-note {
  padding: 0 17px 14px;
  font-size: 8px;
  line-height: 1.8;
  color: var(--muted-2);
}
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 8px;
  font-weight: 800;
  color: var(--brand);
  flex: none;
}
.live-badge i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand);
  animation: teamPulse 2s infinite;
}
@keyframes teamPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 color-mix(in srgb, var(--brand) 28%, transparent); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px transparent; }
}

.activity-list {
  padding: 3px 0 6px;
}
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 9px 17px;
}
.activity-item + .activity-item {
  border-top: 1px solid var(--line);
}
.act-icon {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.act-icon.invite { background: var(--amber-soft); color: var(--amber); }
.act-icon.role { background: #dbeafe; color: #1d4ed8; }
.act-icon.form { background: #ede9fe; color: #6d28d9; }
.act-icon.member { background: #fee2e2; color: #b91c1c; }
.act-icon.security { background: #ccfbf1; color: #0f766e; }
[data-theme="dark"] .act-icon.role { background: #172a45; color: #93c5fd; }
[data-theme="dark"] .act-icon.form { background: #281d43; color: #c4b5fd; }
[data-theme="dark"] .act-icon.member { background: #3a191b; color: #fca5a5; }
.act-icon .icon {
  width: 13px;
  height: 13px;
}
.activity-item > div {
  min-width: 0;
}
.activity-item p {
  font-size: 9px;
  line-height: 1.7;
  color: var(--muted);
}
.activity-item p b {
  color: var(--text);
}
.activity-item time {
  display: block;
  font-size: 8px;
  color: var(--muted-2);
  margin-top: 2px;
}

.team-settings-list {
  padding: 4px 17px 8px;
}
.team-setting,
.profile-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.team-setting:last-child {
  border-bottom: 0;
}
.team-setting > span,
.profile-switch > span {
  flex: 1;
  min-width: 0;
}
.team-setting b,
.profile-switch b {
  display: block;
  font-size: 9.5px;
  margin-bottom: 2px;
}
.team-setting small,
.profile-switch small {
  display: block;
  font-size: 8px;
  line-height: 1.7;
  color: var(--muted-2);
}
.team-setting input,
.profile-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.team-switch {
  width: 34px;
  height: 20px;
  flex: none;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  transition: background 0.2s var(--ease);
}
.team-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.16);
  transition: transform 0.2s var(--ease);
}
.team-setting input:checked + .team-switch,
.profile-switch input:checked + .team-switch {
  background: var(--brand);
}
.team-setting input:checked + .team-switch::after,
.profile-switch input:checked + .team-switch::after {
  transform: translateX(14px);
}

/* ================= disclaimer ================= */
.team-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 18px;
  padding: 13px 16px;
  border: 1px dashed var(--line-2);
  border-radius: 12px;
  background: color-mix(in srgb, var(--brand-soft) 35%, transparent);
}
.team-disclaimer > span {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.team-disclaimer .icon {
  width: 14px;
  height: 14px;
}
.team-disclaimer p {
  font-size: 9px;
  line-height: 1.9;
  color: var(--muted);
}
.team-disclaimer b {
  color: var(--text);
}
.team-disclaimer code {
  font-size: 8px;
  background: var(--surface-2, var(--line));
  padding: 1px 4px;
  border-radius: 4px;
}

/* ================= modals ================= */
.invite-modal-note {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 11px;
  margin-bottom: 12px;
  border-radius: 9px;
  background: var(--brand-soft);
  color: var(--muted);
  font-size: 9px;
  line-height: 1.8;
}
.invite-modal-note .icon {
  width: 13px;
  height: 13px;
  flex: none;
  margin-top: 2px;
  color: var(--brand);
}
.team-form-grid,
.profile-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.check-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.check-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-size: 8.5px;
  color: var(--muted);
  cursor: pointer;
  background: var(--card);
}
.check-chip:has(input:checked) {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  background: var(--brand-soft);
  color: var(--brand);
}
.check-chip input {
  accent-color: var(--brand);
  width: 11px;
  height: 11px;
  margin: 0;
}
.invite-seat-hint {
  margin-top: 10px;
  font-size: 8.5px;
  color: var(--muted-2);
  line-height: 1.8;
}
.field-hint {
  display: block;
  margin-top: 4px;
  font-size: 8px;
  line-height: 1.7;
  color: var(--muted-2);
}
.member-profile-modal {
  max-width: 760px;
  width: min(760px, calc(100vw - 32px));
}
.profile-hero {
  display: flex;
  align-items: center;
  gap: 13px;
  padding-bottom: 13px;
  border-bottom: 1px solid var(--line);
}
.profile-avatar-wrap {
  flex: none;
}
.profile-hero h3 {
  font-size: 15px;
  margin: 0 0 3px;
}
.profile-hero p {
  font-size: 9.5px;
  color: var(--muted-2);
  direction: ltr;
  text-align: right;
}
.profile-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.profile-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 13px 0;
}
.profile-meta-item {
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2, var(--line));
  min-width: 0;
}
.profile-meta-item small {
  display: block;
  font-size: 8px;
  color: var(--muted-2);
  margin-bottom: 2px;
}
.profile-meta-item b {
  display: block;
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.profile-subhead {
  font-size: 10px;
  margin: 13px 0 7px;
  color: var(--muted);
}
.permission-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.permission-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 7px;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 700;
}
.permission-chip .icon {
  width: 10px;
  height: 10px;
}
.permission-chip.yes {
  background: var(--brand-soft);
  color: var(--brand);
}
.permission-chip.no {
  background: var(--surface-2, var(--line));
  color: var(--muted-2);
}
.mini-activity-list {
  display: grid;
  gap: 1px;
}
.mini-activity {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.mini-activity:last-child {
  border-bottom: 0;
}
.mini-activity span {
  flex: none;
  font-size: 8px;
  color: var(--muted-2);
}
.mini-activity p {
  font-size: 8.5px;
  color: var(--muted);
  line-height: 1.7;
}
.profile-switch {
  margin-top: 10px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.profile-foot {
  flex-wrap: wrap;
}
.danger-ghost {
  color: #b91c1c !important;
  border-color: #fecaca !important;
}
[data-theme="dark"] .danger-ghost {
  color: #fca5a5 !important;
  border-color: #5b2428 !important;
}

/* ================= organization nav / overview ================= */
.team-subnav {
  display: flex;
  align-items: center;
  gap: 5px;
  overflow-x: auto;
  margin: -4px 0 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  scrollbar-width: none;
}
.team-subnav::-webkit-scrollbar {
  display: none;
}
.team-subnav a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  padding: 7px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  white-space: nowrap;
}
.team-subnav a:hover {
  background: var(--brand-soft);
  color: var(--brand);
}
.team-subnav .icon {
  width: 13px;
  height: 13px;
}
.org-panel {
  margin-bottom: 18px;
}
.org-head-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.org-company {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  background:
    radial-gradient(circle at 5% 10%, color-mix(in srgb, var(--brand) 10%, transparent), transparent 36%),
    radial-gradient(circle at 96% 90%, color-mix(in srgb, var(--mint) 8%, transparent), transparent 32%);
}
.org-company-main {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}
.org-logo {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  flex: none;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 50%, #0f766e));
  box-shadow: 0 10px 22px -14px color-mix(in srgb, var(--brand) 70%, transparent);
}
.org-logo .icon {
  width: 25px;
  height: 25px;
}
.org-company-copy {
  min-width: 0;
}
.org-kicker {
  display: block;
  color: var(--brand);
  font-size: 8.5px;
  font-weight: 800;
  margin-bottom: 3px;
}
.org-company h2 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
}
.org-company p {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 9.5px;
  line-height: 1.8;
}
.org-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}
.org-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 70%, transparent);
  font-size: 8px;
  font-weight: 700;
  color: var(--muted);
}
.org-tag .icon {
  width: 10px;
  height: 10px;
}
.org-company-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 7px;
  flex: none;
}
.org-company-stats > div {
  min-width: 64px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: color-mix(in srgb, var(--card) 68%, transparent);
}
.org-company-stats b {
  display: block;
  font-size: 17px;
  letter-spacing: -0.02em;
}
.org-company-stats span {
  display: block;
  margin-top: 1px;
  font-size: 7.5px;
  color: var(--muted-2);
  white-space: nowrap;
}

/* ================= org chart ================= */
.org-tree-wrap {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--line);
  overflow-x: auto;
  background: color-mix(in srgb, var(--surface-2, var(--line)) 22%, transparent);
}
.org-tree {
  min-width: 620px;
}
.org-tree-root {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin: 0 auto;
  padding: 9px 12px;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line));
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 8px 22px -18px rgba(0, 0, 0, 0.35);
}
.org-tree-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--brand-soft);
  color: var(--brand);
}
.org-tree-logo .icon {
  width: 17px;
  height: 17px;
}
.org-tree-root b {
  display: block;
  font-size: 11px;
}
.org-tree-root small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
}
.org-tree-badge {
  margin-inline-start: 8px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 7.5px;
  font-weight: 800;
  white-space: nowrap;
}
.org-tree-trunk {
  width: 2px;
  height: 15px;
  margin: 0 auto;
  background: color-mix(in srgb, var(--brand) 28%, var(--line));
}
.org-tree-branches {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  position: relative;
  padding-top: 16px;
}
.org-tree-branches::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12.5%;
  right: 12.5%;
  height: 2px;
  background: color-mix(in srgb, var(--brand) 22%, var(--line));
}
.org-tree-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--text);
  text-align: center;
  font: inherit;
  cursor: pointer;
  transition: 0.18s var(--ease);
}
.org-tree-node::before {
  content: "";
  position: absolute;
  top: -16px;
  left: 50%;
  width: 2px;
  height: 16px;
  background: color-mix(in srgb, var(--brand) 22%, var(--line));
}
.org-tree-node:hover {
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
  background: var(--brand-soft);
  transform: translateY(-1px);
}
.org-tree-node-icon {
  width: 25px;
  height: 25px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.org-tree-node-icon .icon {
  width: 13px;
  height: 13px;
}
.org-tree-node b {
  font-size: 9.5px;
}
.org-tree-node small {
  color: var(--muted-2);
  font-size: 7.5px;
}
.org-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 7px;
}
.org-section-head h4,
.org-subhead h4 {
  font-size: 11px;
  margin: 0;
}
.org-section-head p {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 8.5px;
}
.org-subhead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 15px 18px 7px;
}
.org-subhead span {
  color: var(--muted-2);
  font-size: 8px;
}

/* ================= branch / department cards ================= */
.branch-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 4px 16px 4px;
}
.org-branch-card,
.org-dept-card {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition: 0.18s var(--ease);
}
.org-branch-card:hover,
.org-dept-card:hover {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  box-shadow: 0 10px 28px -24px rgba(0, 0, 0, 0.4);
}
.org-card-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.org-icon {
  width: 31px;
  height: 31px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  background: var(--brand-soft);
  color: var(--brand);
}
.org-icon .icon {
  width: 15px;
  height: 15px;
}
.org-icon.emerald { background: var(--brand-soft); color: var(--brand); }
.org-icon.blue { background: #dbeafe; color: #1d4ed8; }
.org-icon.amber { background: var(--amber-soft); color: var(--amber); }
.org-icon.violet { background: #ede9fe; color: #6d28d9; }
.org-icon.coral { background: #fee2e2; color: #b91c1c; }
[data-theme="dark"] .org-icon.blue { background: #172a45; color: #93c5fd; }
[data-theme="dark"] .org-icon.violet { background: #281d43; color: #c4b5fd; }
[data-theme="dark"] .org-icon.coral { background: #3a191b; color: #fca5a5; }
.org-card-title {
  min-width: 0;
  flex: 1;
}
.org-card-title b {
  display: block;
  font-size: 10.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-card-title small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-status {
  display: inline-flex;
  width: fit-content;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 800;
  white-space: nowrap;
}
.org-status.active {
  background: var(--brand-soft);
  color: var(--brand);
}
.org-status.inactive {
  background: var(--surface-2, var(--line));
  color: var(--muted-2);
}
.org-address {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  margin-top: 8px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.7;
}
.org-address .icon {
  width: 11px;
  height: 11px;
  flex: none;
  margin-top: 2px;
}
.org-manager {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.org-manager small {
  display: block;
  color: var(--muted-2);
  font-size: 7.5px;
}
.org-manager b {
  display: block;
  margin-top: 1px;
  font-size: 9px;
}
.org-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
}
.org-metrics span {
  display: flex;
  align-items: baseline;
  gap: 3px;
  padding: 4px 5px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--surface-2, var(--line)) 55%, transparent);
  min-width: 0;
}
.org-metrics b {
  font-size: 9.5px;
}
.org-metrics small {
  color: var(--muted-2);
  font-size: 7px;
}
.org-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
}
.org-card-actions .btn {
  flex: 1;
}
.department-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  padding: 4px 16px 17px;
}
.org-dept-desc {
  min-height: 28px;
  margin-top: 7px;
  color: var(--muted-2);
  font-size: 8px;
  line-height: 1.75;
}
.org-dept-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 7px;
  border-top: 1px solid var(--line);
}
.org-dept-foot span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted-2);
  font-size: 7.5px;
}
.org-dept-foot .icon {
  width: 10px;
  height: 10px;
}

/* ================= surveyors ================= */
.surveyor-panel,
.form-access-panel {
  margin-top: 18px;
}
.surveyor-toolbar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2, var(--line)) 32%, transparent);
}
.surveyor-toolbar .team-search {
  flex: 1;
  min-width: 190px;
}
.surveyor-toolbar select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 9px;
  padding: 0 8px;
}
.surveyor-list-head,
.surveyor-row {
  display: grid;
  grid-template-columns: minmax(170px, 1.4fr) minmax(125px, 1fr) 96px 73px 92px 57px;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
}
.surveyor-list-head {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2, var(--line)) 22%, transparent);
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
}
.surveyor-row {
  border-bottom: 1px solid var(--line);
  transition: background 0.18s var(--ease);
}
.surveyor-row:hover {
  background: color-mix(in srgb, var(--brand-soft) 35%, transparent);
}
.surveyor-row:last-child {
  border-bottom: 0;
}
.surveyor-identity {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.surveyor-identity > div {
  min-width: 0;
}
.surveyor-identity b {
  display: block;
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.surveyor-identity small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 7.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.surveyor-org {
  min-width: 0;
}
.org-mini-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 100%;
  padding: 3px 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2, var(--line)) 70%, transparent);
  color: var(--muted);
  font-size: 7.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.org-mini-chip .icon {
  width: 10px;
  height: 10px;
}
.surveyor-org > small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 7.5px;
  direction: ltr;
  text-align: right;
}
.surveyor-stats {
  display: flex;
  gap: 8px;
}
.surveyor-stats b {
  display: block;
  font-size: 10px;
}
.surveyor-stats small {
  display: block;
  color: var(--muted-2);
  font-size: 7px;
}
.surveyor-rating {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}
.surveyor-rating .icon {
  width: 11px;
  height: 11px;
  color: var(--amber);
  fill: color-mix(in srgb, var(--amber) 20%, transparent);
}
.surveyor-rating b {
  font-size: 9.5px;
}
.surveyor-rating small {
  width: 100%;
  color: var(--muted-2);
  font-size: 7px;
}
.surveyor-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
}
.surveyor-state small {
  color: var(--muted-2);
  font-size: 7px;
}
.surveyor-status {
  display: inline-flex;
  padding: 3px 6px;
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 800;
  white-space: nowrap;
}
.surveyor-status.active { background: var(--brand-soft); color: var(--brand); }
.surveyor-status.leave { background: var(--amber-soft); color: var(--amber); }
.surveyor-status.inactive { background: var(--surface-2, var(--line)); color: var(--muted-2); }
.surveyor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
}
.surveyor-actions .btn-icon {
  color: var(--muted-2);
}
.surveyor-actions .btn-icon:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

/* ================= form access ================= */
.form-access-head,
.form-access-row {
  display: grid;
  grid-template-columns: minmax(185px, 1.3fr) minmax(190px, 1.5fr) 105px 75px 76px;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
}
.form-access-head {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2, var(--line)) 22%, transparent);
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 800;
}
.form-access-row {
  border-bottom: 1px solid var(--line);
}
.form-access-row:last-child {
  border-bottom: 0;
}
.fa-form {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.fa-icon {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
  background: #ede9fe;
  color: #6d28d9;
}
.fa-icon .icon {
  width: 14px;
  height: 14px;
}
[data-theme="dark"] .fa-icon {
  background: #281d43;
  color: #c4b5fd;
}
.fa-form > div {
  min-width: 0;
}
.fa-form b {
  display: block;
  font-size: 9.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fa-form small {
  display: block;
  margin-top: 2px;
  color: var(--muted-2);
  font-size: 7.5px;
}
.fa-scopes {
  min-width: 0;
}
.fa-chips {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.fa-scope-chip {
  display: inline-flex;
  padding: 3px 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 7.5px;
  font-weight: 800;
  white-space: nowrap;
}
.fa-scope-chip.empty {
  background: var(--surface-2, var(--line));
  color: var(--muted-2);
}
.fa-scopes > small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 7.5px;
  line-height: 1.6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.access-pill {
  display: inline-flex;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 7.5px;
  font-weight: 800;
  white-space: nowrap;
}
.access-pill.manage { background: #ede9fe; color: #6d28d9; }
.access-pill.collect { background: var(--brand-soft); color: var(--brand); }
.access-pill.view { background: var(--surface-2, var(--line)); color: var(--muted); }
[data-theme="dark"] .access-pill.manage { background: #281d43; color: #c4b5fd; }
.fa-action {
  display: flex;
  justify-content: flex-end;
}

/* ================= org modals ================= */
.org-modal {
  max-width: 720px;
  width: min(720px, calc(100vw - 32px));
}
.form-access-modal {
  max-width: 760px;
  width: min(760px, calc(100vw - 32px));
}
.org-modal .field + .field,
.org-modal .team-form-grid + .field {
  margin-top: 10px;
}
.org-modal .invite-modal-note {
  margin-top: 12px;
  margin-bottom: 0;
}
.profile-org-grid {
  margin-top: 10px;
}
.access-fieldset {
  margin: 12px 0 0;
  padding: 9px 10px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.access-fieldset legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}
.access-fieldset .check-grid {
  max-height: 130px;
  overflow: auto;
  padding: 2px;
}
.org-active-switch {
  margin: 0;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
}

@media (max-width: 1160px) {
  .team-layout {
    grid-template-columns: 1fr;
  }
  .team-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }
}
@media (max-width: 940px) {
  .team-hero {
    align-items: flex-start;
    flex-direction: column;
  }
  .team-hero-side {
    width: 100%;
    justify-content: space-between;
  }
  .team-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .team-side-card:first-child {
    grid-column: 1 / -1;
  }
}
@media (max-width: 780px) {
  .member-list-head {
    display: none;
  }
  .member-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity identity"
      "role actions"
      "groups groups"
      "security security";
    gap: 8px 10px;
    margin: 10px 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--card);
  }
  .member-row:last-child {
    border-bottom: 1px solid var(--line);
  }
  .member-identity { grid-area: identity; }
  .member-role-cell { grid-area: role; flex-direction: row; align-items: center; }
  .member-groups { grid-area: groups; }
  .member-security { grid-area: security; flex-direction: row; align-items: center; justify-content: space-between; }
  .member-actions { grid-area: actions; }
  .group-grid {
    grid-template-columns: 1fr;
  }
  .team-form-grid,
  .profile-edit-grid {
    grid-template-columns: 1fr;
  }
  .profile-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  .team-page-head {
    gap: 12px;
  }
  .team-page-head .page-head-actions {
    width: 100%;
  }
  .team-page-head .page-head-actions .btn {
    flex: 1;
  }
  .team-hero {
    padding: 16px;
  }
  .workspace-logo {
    width: 52px;
    height: 52px;
    border-radius: 15px;
  }
  .workspace-logo .icon {
    width: 24px;
    height: 24px;
  }
  .team-hero h2 {
    font-size: 17px;
  }
  .team-hero-side {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  .hero-plan {
    justify-content: flex-start;
  }
  .hero-renew {
    border-inline-start: 0;
    padding-inline-start: 0;
    padding-top: 8px;
    border-top: 1px solid var(--line);
  }
  .team-members-toolbar {
    align-items: stretch;
  }
  .team-status-tabs {
    width: 100%;
  }
  .team-status-tabs button {
    flex: 1;
  }
  .team-filter-row {
    width: 100%;
  }
  .team-search {
    width: 100%;
    flex: 1;
  }
  #teamRoleFilter {
    flex: 1;
    min-width: 0;
  }
  .invite-row {
    flex-wrap: wrap;
    padding: 11px 12px;
  }
  .invite-copy {
    flex-basis: calc(100% - 40px);
  }
  .invite-expiry {
    text-align: right;
    padding-inline: 0 30px;
  }
  .invite-actions {
    margin-inline-start: auto;
  }
  .team-side {
    grid-template-columns: 1fr;
  }
  .team-side-card:first-child {
    grid-column: auto;
  }
  .team-page .panel-head {
    padding: 14px 13px;
  }
  .team-members-toolbar,
  .team-list-foot {
    padding-inline: 13px;
  }
  .profile-meta {
    grid-template-columns: 1fr;
  }
  .member-profile-modal {
    max-height: calc(100vh - 18px);
  }
}
@media (max-width: 430px) {
  .team-hero-main {
    align-items: flex-start;
  }
  .hero-avatars .tm-avatar:nth-child(n + 5) {
    display: none;
  }
  .member-row {
    margin-inline: 9px;
    padding: 10px;
  }
  .role-select {
    max-width: 90px;
  }
  .member-actions .btn-icon {
    width: 25px;
    height: 25px;
  }
  .invite-copy > b {
    font-size: 9px;
  }
  .group-grid {
    padding-inline: 12px;
  }
  .role-table-wrap {
    padding-inline: 12px;
  }
}

/* ================= organization responsive ================= */
@media (max-width: 1160px) {
  .department-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 940px) {
  .org-company {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .org-company-stats {
    width: 100%;
  }
  .surveyor-list-head,
  .surveyor-row {
    grid-template-columns: minmax(160px, 1.4fr) minmax(120px, 1fr) 90px 70px 88px 54px;
    padding-inline: 13px;
  }
  .form-access-head,
  .form-access-row {
    grid-template-columns: minmax(170px, 1.3fr) minmax(155px, 1.4fr) 98px 70px 68px;
    padding-inline: 13px;
  }
}
@media (max-width: 780px) {
  .team-subnav {
    margin-top: -2px;
  }
  .org-company {
    padding: 14px;
  }
  .org-company-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .org-tree-wrap {
    padding: 14px;
  }
  .org-tree {
    min-width: 0;
  }
  .org-tree-root {
    width: 100%;
  }
  .org-tree-branches {
    grid-template-columns: 1fr;
    gap: 6px;
    padding-top: 0;
  }
  .org-tree-branches::before,
  .org-tree-node::before {
    display: none;
  }
  .org-tree-node {
    flex-direction: row;
    text-align: right;
    gap: 8px;
    padding: 8px 10px;
  }
  .org-tree-node b {
    flex: 1;
    font-size: 10px;
  }
  .org-tree-node small {
    font-size: 8px;
  }
  .branch-grid {
    grid-template-columns: 1fr;
    padding-inline: 13px;
  }
  .department-grid {
    grid-template-columns: 1fr;
    padding-inline: 13px;
  }
  .org-section-head,
  .org-subhead {
    padding-inline: 13px;
  }
  .surveyor-list-head,
  .form-access-head {
    display: none;
  }
  .surveyor-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "identity state"
      "org org"
      "stats rating"
      "actions actions";
    gap: 7px 9px;
    margin: 9px 12px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .surveyor-row:last-child {
    border-bottom: 1px solid var(--line);
  }
  .surveyor-identity { grid-area: identity; }
  .surveyor-org { grid-area: org; }
  .surveyor-stats { grid-area: stats; }
  .surveyor-rating { grid-area: rating; justify-content: flex-end; }
  .surveyor-state { grid-area: state; align-items: flex-end; }
  .surveyor-actions { grid-area: actions; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 6px; }
  .form-access-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "form form"
      "scopes scopes"
      "access state"
      "action action";
    gap: 7px 9px;
    margin: 9px 12px;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 12px;
  }
  .form-access-row:last-child {
    border-bottom: 1px solid var(--line);
  }
  .fa-form { grid-area: form; }
  .fa-scopes { grid-area: scopes; }
  .fa-access { grid-area: access; }
  .fa-state { grid-area: state; justify-self: end; }
  .fa-action { grid-area: action; border-top: 1px solid var(--line); padding-top: 6px; }
  .fa-action .btn { width: 100%; }
}
@media (max-width: 640px) {
  .org-head-actions {
    width: 100%;
  }
  .org-head-actions .btn {
    flex: 1;
  }
  .org-company-main {
    align-items: flex-start;
  }
  .org-company-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .org-company-stats > div {
    min-width: 0;
  }
  .org-logo {
    width: 44px;
    height: 44px;
    border-radius: 13px;
  }
  .org-logo .icon {
    width: 21px;
    height: 21px;
  }
  .org-tree,
  .org-tree-branches {
    min-width: 0;
  }
  .org-tree-branches {
    grid-template-columns: 1fr;
  }
  .surveyor-toolbar {
    align-items: stretch;
    padding-inline: 13px;
  }
  .surveyor-toolbar .team-search {
    flex-basis: 100%;
  }
  .surveyor-toolbar select {
    flex: 1;
    min-width: 0;
  }
  .org-modal,
  .form-access-modal {
    max-height: calc(100vh - 18px);
  }
}
@media (max-width: 430px) {
  .org-company-copy h2 {
    font-size: 16px;
  }
  .org-metrics {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .org-card-actions {
    flex-wrap: wrap;
  }
  .surveyor-row {
    margin-inline: 9px;
  }
  .form-access-row {
    margin-inline: 9px;
  }
}
