.reference-team .screen-actions {
  justify-content:flex-end;
}
.reference-team .metric-grid {
  grid-template-columns:repeat(4, minmax(0, 1fr));
}
.team-layout {
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(0, 1fr);
  gap:12px;
}
.reference-team .panel {
  padding:18px 20px;
}
.reference-team .panel-header {
  margin-bottom:12px;
  align-items:flex-start;
}
.reference-team .panel-header h2 {
  flex:0 0 auto;
  max-width:100%;
  white-space:nowrap;
}
.toolbar-mini {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
  justify-content:flex-end;
  flex:1 1 360px;
  min-width:0;
}
.toolbar-mini input,
.toolbar-mini select {
  flex:1 1 190px;
  min-width:0;
  width:auto;
  min-height:38px;
}
.role-pill {
  display:inline-flex;
  align-items:center;
  min-height:26px;
  padding:4px 10px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:6px;
  color:#d8d2c8;
  background:rgba(255,255,255,.025);
}
.role-pill.gold { color:var(--gold); border-color:rgba(248,189,36,.5); background:rgba(248,189,36,.12); }
.role-pill.blue { color:var(--blue); border-color:rgba(46,145,255,.38); background:rgba(46,145,255,.1); }
.role-pill.green { color:var(--green); border-color:rgba(40,211,104,.38); background:rgba(40,211,104,.1); }
.role-pill.purple { color:#bd6fff; border-color:rgba(189,111,255,.38); background:rgba(189,111,255,.1); }
.permission-dots { color:var(--gold); letter-spacing:2px; }
.reference-team table th,
.reference-team table td {
  height:42px;
  padding:8px 12px;
}
.reference-team .user-chip {
  margin-right:8px;
}
.team-table-scroll {
  width:100%;
  overflow-x:auto;
}
.team-members-table {
  width:100%;
  min-width:760px;
  table-layout:fixed;
}
.team-members-table th:nth-child(1) { width:19%; }
.team-members-table th:nth-child(2) { width:15%; }
.team-members-table th:nth-child(3) { width:13%; }
.team-members-table th:nth-child(4) { width:35%; }
.team-members-table th:nth-child(5) { width:18%; }
.team-members-table td {
  min-width:0;
  overflow:hidden;
}
.team-members-table .clickable-row {
  cursor:pointer;
}
.team-members-table .clickable-row:hover td,
.team-members-table .clickable-row:focus td {
  background:rgba(248,189,36,.055);
}
.team-members-table .clickable-row:focus {
  outline:1px solid rgba(248,189,36,.5);
  outline-offset:-2px;
}
.team-member-cell {
  display:flex;
  align-items:center;
  min-width:0;
}
.team-member-cell strong,
.team-email {
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.workspace-chip-list {
  display:flex;
  flex-wrap:wrap;
  gap:5px;
  min-width:0;
}
.workspace-chip-list .tag {
  display:block;
  max-width:160px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.reference-team .row-actions {
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  justify-content:flex-start;
}
.reference-team .row-button {
  min-width:0;
  padding:6px 9px;
  white-space:nowrap;
}
.workspace-access-table {
  min-width:620px;
  table-layout:fixed;
}
.workspace-access-table th:nth-child(1) { width:24%; }
.workspace-access-table th:nth-child(2) { width:32%; }
.workspace-access-table th:nth-child(3) { width:18%; }
.workspace-access-table th:nth-child(4) { width:26%; }
.workspace-access-table td {
  overflow-wrap:anywhere;
}
.workspace-access-table .row-actions {
  flex-wrap:nowrap;
}
.permission-level {
  white-space:nowrap;
}
.permission-matrix table th,
.permission-matrix table td { text-align:center; }
.permission-matrix table th:first-child,
.permission-matrix table td:first-child { text-align:left; }
.permission-matrix th small {
  display:block;
  margin-top:2px;
  color:var(--muted);
  font-weight:600;
}
.permission-cell {
  min-height:30px;
  width:100%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  border:0;
  background:transparent;
  color:#d8d2c8;
  padding:0;
}
.permission-cell:hover {
  color:var(--gold-2);
  transform:none;
}
.danger-button {
  min-height:42px;
  padding:0 18px;
  border:1px solid rgba(255,78,66,.55);
  border-radius:8px;
  color:#fff;
  background:linear-gradient(180deg, rgba(255,78,66,.36), rgba(155,28,20,.42));
  font-weight:800;
  box-shadow:0 12px 26px rgba(255,78,66,.14);
}
.danger-button:hover {
  border-color:rgba(255,128,118,.75);
  background:linear-gradient(180deg, rgba(255,92,82,.44), rgba(155,28,20,.5));
}
.team-detail-modal {
  display:flex;
  flex-direction:column;
  overflow:hidden;
  width:min(640px, calc(100vw - 32px));
  max-height:min(760px, calc(100vh - 48px));
}
.team-detail-modal .modal-header {
  flex-shrink:0;
  padding:22px 28px 16px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.team-detail-body {
  display:grid;
  gap:16px;
  min-height:0;
  padding:20px 28px;
  overflow:auto;
}
.team-detail-modal .modal-footer {
  flex-shrink:0;
  display:flex;
  justify-content:flex-end;
  padding:16px 28px 20px;
  border-top:1px solid rgba(255,255,255,.08);
}
.team-detail-body .account-summary {
  margin:0;
  padding:12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px;
  background:rgba(255,255,255,.025);
}
.member-detail-grid {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
}
.member-detail-grid > div,
.member-workspace-list {
  min-width:0;
  display:grid;
  gap:8px;
  padding:12px;
  border:1px solid rgba(255,255,255,.08);
  border-radius:8px;
  background:rgba(255,255,255,.02);
}
.member-detail-grid span,
.member-workspace-list > span {
  color:#aaa298;
  font-size:12px;
  font-weight:800;
}
.member-detail-grid strong {
  color:#f5efe5;
}
.member-workspace-list > div {
  min-width:0;
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}
.team-detail-body .chip-row {
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.member-workspace-list em {
  color:#a79f94;
  font-style:normal;
}
.team-detail-body .field-hint {
  margin:0;
  padding:12px;
  border-radius:8px;
  background:rgba(248,189,36,.055);
}

.admin-finance-landing {
  display:grid;
  gap:8px;
  padding:24px;
  border:1px solid rgba(248,189,36,.26);
  border-radius:16px;
  background:linear-gradient(135deg, rgba(248,189,36,.12), rgba(255,255,255,.025));
}
.admin-finance-landing h2 {
  margin:0;
  color:#fff6db;
  font:900 34px/1 Georgia, "Times New Roman", serif;
}
.admin-finance-landing p:last-child {
  max-width:880px;
  margin:0;
  color:#cfc5b5;
  line-height:1.55;
}

@media (max-width: 1500px) {
  .team-layout {
    grid-template-columns:minmax(0, 1fr);
  }
  .team-members-table,
  .workspace-access-table {
    min-width:720px;
  }
}
@media (max-width: 640px) {
  .member-detail-grid {
    grid-template-columns:1fr;
  }
  .team-detail-body {
    padding:16px;
  }
}
