.member-row {
  border: 2px solid #7c3aed;
  background: linear-gradient(180deg, rgba(243, 232, 255, 0.5), rgba(255, 255, 255, 0.98));
  border-radius: 16px;
  box-shadow: 0 12px 24px rgba(91, 33, 182, 0.1);
  padding: 12px 14px;
  font-size: 14px;
  position: relative;
}

.employee-phones {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.phone-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #ffffff;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  margin-bottom: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  transition: all 0.15s ease;
}

.phone-btn:last-child {
  margin-bottom: 0;
}

.phone-btn.active {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(34, 197, 94, 0.4);
}

.phone-btn.inactive {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(239, 68, 68, 0.4);
  cursor: default;
}

.phone-btn.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(34, 197, 94, 0.42);
}

.phone-btn:active {
  transform: scale(0.93);
}

.member-row-main {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) minmax(110px, auto) repeat(3, minmax(110px, auto));
  gap: 10px 14px;
  align-items: center;
  padding-right: 58px;
}

.member-row-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
}

.member-row-role,
.member-row-stat {
  font-size: 13px;
  color: #334155;
}

.member-row-stat strong {
  color: #0f172a;
}

.member-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.member-row--clean {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.14);
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  align-items: flex-start;
  text-align: left;
}

.member-row--clean:hover {
  background: #fcfdff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.member-row--problem::before {
  content: "";
  position: absolute;
  inset: 12px auto 12px 0;
  width: 2px;
  border-radius: 999px;
  background: #f08a8a;
}

.member-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.member-card-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: left;
  flex: 1 1 auto;
}

.member-card-top-actions {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}

.member-row--clean .member-row-name {
  font-size: 18px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.3;
  margin-bottom: 4px;
}

.member-row--clean .member-row-role {
  font-size: 13px;
  color: #6b7280;
  font-weight: 500;
}

.employee-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
  width: 100%;
}

.employee-roles-empty {
  font-size: 12px;
  color: #94a3b8;
  font-weight: 500;
}

.role-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.role-owner {
  background: #2d3748;
  color: #ffffff;
}

.role-operations-manager {
  background: #e3f0ff;
  color: #2b6cb0;
}

.role-legal {
  background: #f3e8ff;
  color: #6b46c1;
}

.role-accountant {
  background: #e6fffa;
  color: #2f855a;
}

.role-chief-accountant {
  background: #d1fae5;
  color: #065f46;
}

.role-account-manager {
  background: #fff4e6;
  color: #c05621;
}

.employee-status-line {
  margin: 6px 0 12px 0;
  width: 100%;
}

.employee-status-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.employee-status-inline::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  flex: 0 0 auto;
}

.status-active {
  color: #2f855a;
}

.status-inactive {
  color: #c53030;
}

.member-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.member-status-badge--ok {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.member-status-badge--danger {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.users-scope-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px;
  background: #f8fafc;
}

.users-scope-tab {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  background: transparent;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.users-scope-tab span {
  color: #94a3b8;
  margin-left: 4px;
}

.users-scope-tab.is-active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

@media (max-width: 640px) {
  .employee-phones {
    top: 12px;
    right: 12px;
  }

  .phone-btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .member-row-main {
    padding-right: 58px;
  }

  .member-card-top {
    flex-direction: column;
    align-items: stretch;
  }

  .member-card-top-actions {
    justify-content: space-between;
  }

  .users-scope-tabs {
    display: flex;
    width: 100%;
  }

  .users-scope-tab {
    flex: 1 1 0;
  }
}

@media (max-width: 720px) {
  .member-row-main {
    grid-template-columns: 1fr;
  }
}
